2017-04-29 14:52:12 +00:00
|
|
|
const electronPublicApi = ['electron'];
|
2016-01-23 03:47:28 +00:00
|
|
|
|
2017-04-29 14:52:12 +00:00
|
|
|
const nodeModules = {};
|
|
|
|
electronPublicApi.forEach((apiString) => {
|
|
|
|
nodeModules[apiString] = `commonjs ${apiString}`;
|
2016-01-25 02:31:54 +00:00
|
|
|
});
|
2016-01-23 03:47:28 +00:00
|
|
|
|
|
|
|
module.exports = {
|
2017-04-29 14:52:12 +00:00
|
|
|
target: 'node',
|
|
|
|
output: {
|
|
|
|
filename: 'main.js',
|
|
|
|
},
|
|
|
|
node: {
|
|
|
|
global: false,
|
|
|
|
__dirname: false,
|
|
|
|
},
|
|
|
|
externals: nodeModules,
|
|
|
|
module: {
|
|
|
|
loaders: [
|
2017-11-14 13:05:01 +00:00
|
|
|
{ test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader' },
|
2017-04-29 14:52:12 +00:00
|
|
|
],
|
|
|
|
},
|
|
|
|
devtool: 'source-map',
|
2016-01-23 03:47:28 +00:00
|
|
|
};
|