From e5eb9c6b77aa7b524b809856a95d323cfe0e9d5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=ABck=20V=C3=A9zien?= Date: Mon, 15 Jan 2018 15:44:18 +0100 Subject: [PATCH] Use the same webpack as electron-webpack for internals --- webpack/internals.config.js | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/webpack/internals.config.js b/webpack/internals.config.js index 65a39761..a0e94e5d 100644 --- a/webpack/internals.config.js +++ b/webpack/internals.config.js @@ -1,6 +1,5 @@ const path = require('path') const fs = require('fs') -const webpack = require('webpack') const webpackMain = require('electron-webpack/webpack.main.config') // eslint-disable-line import/no-extraneous-dependencies const define = require('./define') @@ -17,35 +16,24 @@ const dirs = p => }, {}) module.exports = webpackMain().then(config => ({ - target: 'electron-main', + context: config.context, + devtool: config.devtool, + target: config.target, entry: dirs(path.resolve(__dirname, '../src/internals')), resolve: { - extensions: ['.js', '.json', '.node'], + extensions: config.extensions, }, externals: ['node-hid', ...config.externals], output: { path: path.resolve(__dirname, '../dist/internals'), - filename: '[name].js', - libraryTarget: 'commonjs2', + ...config.output, }, - module: { - rules: [ - { - test: /\.js$/, - use: 'babel-loader', - exclude: /node_modules/, - }, - { - test: /\.node$/, - use: 'node-loader', - }, - ], - }, + module: config.module, - plugins: [define, new webpack.optimize.ModuleConcatenationPlugin()], + plugins: [define, ...config.plugins], }))