ifProduction, ifNotProduction } = (0, _webpackConfigUtils.getIfUtils)(env); return { name: 'server', cache: ifNotProduction(), devtool: ifProduction('hidden-source-map', 'cheap-module-eval-source-map'), entry: (0, _webpackConfigUtils.removeEmpty)([ifNotProduction('webpack/hot/poll?1000'), (0, _path.resolve)('./src/server/index.js')]), target: 'node', watch: ifNotProduction(), stats: ifProduction('errors-only', 'minimal'), node: { __dirname: false, whitelist: ['webpack/hot/poll?1000'] })], plugins: (0, _webpackConfigUtils.removeEmpty)([new _progressBarWebpackPlugin.default(), new _webpack.default.IgnorePlugin(/\.(scss|css|less)$/), new _webpack.default.NamedModulesPlugin(), ifNotProduction(new _cleanWebpackPlugin.default('./dist/')), ifNotProduction(new _startServerWebpackPlugin.default('server.js')), ifNotProduction(new _webpack.default.HotModuleReplacementPlugin()), ifNotProduction(new _webpack.default.NoEmitOnErrorsPlugin())]) };
ifProduction, ifNotProduction } = (0, _webpackConfigUtils.getIfUtils)(env); return { name: 'client', cache: ifNotProduction(), devtool: ifNotProduction('cheap-module-eval-source-map'), entry: [(0, _path.resolve)('./src/client/index.js')], target: 'web', watch: false, stats: ifProduction('errors-only', 'minimal'), module: { rules: [{ filename: 'client.js' }, plugins: (0, _webpackConfigUtils.removeEmpty)([new _progressBarWebpackPlugin.default(), new _webpack.default.EnvironmentPlugin((0, _extractNpmPackageConfig.default)(env)), new _webpack.default.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify(ifProduction('production', process.env.NODE_ENV)) }), ifProduction(new _uglifyjsWebpackPlugin.default({ uglifyOptions: { ie8: false, }, sourceMap: false })), ifProduction(new _webpack.default.optimize.AggressiveMergingPlugin()), // merge chunks ifProduction(new _webpack.default.optimize.ModuleConcatenationPlugin()), // scope hoisting ifProduction(new _webpack.default.HashedModuleIdsPlugin()), // scope hoisting ifProduction(new _lodashWebpackPlugin.default()), ifNotProduction(new _webpack.default.HotModuleReplacementPlugin()), ifNotProduction(new _webpack.default.NamedModulesPlugin()), ifNotProduction(new _webpack.default.NoEmitOnErrorsPlugin())]) };
removeEmpty([ ifDevelopment( new webpack.HotModuleReplacementPlugin(), new webpack.NamedModulesPlugin() ifDevelopment( new EventHooksPlugin({ afterEmit: function(compilation) {
removeEmpty({ mode: ifProduction('production', 'development'), devtool: ifProduction('source-map', 'cheap-module-eval-source-map'), entry: removeEmpty([ propIf(doHmr, 'webpack-hot-middleware/client'), path.resolve(__dirname, 'src/index.js') ]), output: { path: path.resolve(__dirname, 'public'), filename: ifProduction('js/[name]-[contenthash:8].js', 'js/[name].js'), publicPath: '/', // Needed for hot module reloading and webpack adjusting asset paths properly. globalObject: 'this' // https://github.com/webpack/webpack/issues/6642 plugins: removeEmpty([ propIfNot(doHmr, new CleanWebpackPlugin([ 'public/js', 'public/css', new DotenvWebpackPlugin(), new webpack.HashedModuleIdsPlugin(), propIf(doHmr, new webpack.HotModuleReplacementPlugin()), new HtmlWebpackPlugin({ template: path.resolve(__dirname, 'src/index.html'), title: process.env.OA_APP_NAME, minify: ifProduction( }), new MiniCssExtractPlugin({ filename: ifProduction('css/[name]-[contenthash:8].css', 'css/[name].css') }),
ifProduction, ifNotProduction } = (0, _webpackConfigUtils.getIfUtils)(env); return { name: 'server', cache: ifNotProduction(), devtool: ifProduction('hidden-source-map', 'cheap-module-eval-source-map'), entry: (0, _webpackConfigUtils.removeEmpty)([ifNotProduction('webpack/hot/poll?1000'), (0, _path.resolve)('./src/server/index.js')]), target: 'node', watch: ifNotProduction(), stats: ifProduction('errors-only', 'minimal'), node: { __dirname: false, whitelist: ['webpack/hot/poll?1000'] })], plugins: (0, _webpackConfigUtils.removeEmpty)([new _progressBarWebpackPlugin.default(), new _webpack.default.IgnorePlugin(/\.(scss|css|less)$/), new _webpack.default.NamedModulesPlugin(), ifNotProduction(new _cleanWebpackPlugin.default('./dist/')), ifNotProduction(new _startServerWebpackPlugin.default('server.js')), ifNotProduction(new _webpack.default.HotModuleReplacementPlugin()), ifNotProduction(new _webpack.default.NoEmitOnErrorsPlugin())]) };
ifProduction, ifNotProduction } = (0, _webpackConfigUtils.getIfUtils)(env); return { name: 'client', cache: ifNotProduction(), devtool: ifNotProduction('cheap-module-eval-source-map'), entry: [(0, _path.resolve)('./src/client/index.js')], target: 'web', watch: false, stats: ifProduction('errors-only', 'minimal'), module: { rules: [{ filename: 'client.js' }, plugins: (0, _webpackConfigUtils.removeEmpty)([new _progressBarWebpackPlugin.default(), new _webpack.default.EnvironmentPlugin((0, _extractNpmPackageConfig.default)(env)), new _webpack.default.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify(ifProduction('production', process.env.NODE_ENV)) }), ifProduction(new _uglifyjsWebpackPlugin.default({ uglifyOptions: { ie8: false, }, sourceMap: false })), ifProduction(new _webpack.default.optimize.AggressiveMergingPlugin()), // merge chunks ifProduction(new _webpack.default.optimize.ModuleConcatenationPlugin()), // scope hoisting ifProduction(new _webpack.default.HashedModuleIdsPlugin()), // scope hoisting ifProduction(new _lodashWebpackPlugin.default()), ifNotProduction(new _webpack.default.HotModuleReplacementPlugin()), ifNotProduction(new _webpack.default.NamedModulesPlugin()), ifNotProduction(new _webpack.default.NoEmitOnErrorsPlugin())]) };