Skip to content

Commit

Permalink
updated internals and webpack configs
Browse files Browse the repository at this point in the history
  • Loading branch information
jdpigeon committed Aug 9, 2020
1 parent a55e19e commit 5ab998c
Show file tree
Hide file tree
Showing 8 changed files with 162 additions and 161 deletions.
20 changes: 10 additions & 10 deletions configs/webpack.config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,32 @@ export default {
use: {
loader: 'babel-loader',
options: {
cacheDirectory: true
}
}
}
]
cacheDirectory: true,
},
},
},
],
},

output: {
path: path.join(__dirname, '..', 'app'),
// https://github.com/webpack/webpack/issues/1114
libraryTarget: 'commonjs2'
libraryTarget: 'commonjs2',
},

/**
* Determine the array of extensions that should be used to resolve modules.
*/
resolve: {
extensions: ['.js', '.jsx', '.json', '.ts', '.tsx'],
modules: [path.join(__dirname, '..', 'app'), 'node_modules']
modules: [path.join(__dirname, '..', 'app'), 'node_modules'],
},

plugins: [
new webpack.EnvironmentPlugin({
NODE_ENV: 'production'
NODE_ENV: 'production',
}),

new webpack.NamedModulesPlugin()
]
new webpack.NamedModulesPlugin(),
],
};
22 changes: 11 additions & 11 deletions configs/webpack.config.main.prod.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import path from 'path';
import webpack from 'webpack';
import merge from 'webpack-merge';
import { merge } from 'webpack-merge';
import TerserPlugin from 'terser-webpack-plugin';
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
import baseConfig from './webpack.config.base';
Expand All @@ -14,7 +14,7 @@ import DeleteSourceMaps from '../internals/scripts/DeleteSourceMaps';
CheckNodeEnv('production');
DeleteSourceMaps();

export default merge.smart(baseConfig, {
export default merge(baseConfig, {
devtool: process.env.DEBUG_PROD === 'true' ? 'source-map' : 'none',

mode: 'production',
Expand All @@ -25,7 +25,7 @@ export default merge.smart(baseConfig, {

output: {
path: path.join(__dirname, '..'),
filename: './app/main.prod.js'
filename: './app/main.prod.js',
},

optimization: {
Expand All @@ -35,16 +35,16 @@ export default merge.smart(baseConfig, {
new TerserPlugin({
parallel: true,
sourceMap: true,
cache: true
})
]
cache: true,
}),
],
},

plugins: [
new BundleAnalyzerPlugin({
analyzerMode:
process.env.OPEN_ANALYZER === 'true' ? 'server' : 'disabled',
openAnalyzer: process.env.OPEN_ANALYZER === 'true'
openAnalyzer: process.env.OPEN_ANALYZER === 'true',
}),

/**
Expand All @@ -60,8 +60,8 @@ export default merge.smart(baseConfig, {
NODE_ENV: 'production',
DEBUG_PROD: false,
START_MINIMIZED: false,
E2E_BUILD: false
})
E2E_BUILD: false,
}),
],

/**
Expand All @@ -71,6 +71,6 @@ export default merge.smart(baseConfig, {
*/
node: {
__dirname: false,
__filename: false
}
__filename: false,
},
});
Loading

0 comments on commit 5ab998c

Please sign in to comment.