electron in webpack 1

electron in webpack

const webpack = require("webpack");

module.exports = {
    plugins: [
        new webpack.ExternalsPlugin('commonjs', [
            'electron'
        ])
    ]
    ...
}

Here is what the above code is Doing:
1. We’re using the webpack.ExternalsPlugin to tell webpack that we don’t want to bundle the electron module.
2. We’re telling webpack that we want to use the commonjs module system for electron.
3. We’re telling webpack that we want to use the electron module.

Now, we can use the electron module in our code.

Similar Posts