|
|
|
@ -5,7 +5,7 @@ const CssMinimizerPlugin = require('css-minimizer-webpack-plugin') |
|
|
|
|
|
|
|
|
|
const versionData = { |
|
|
|
|
timestamp: Date.now(), |
|
|
|
|
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development' |
|
|
|
|
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development', |
|
|
|
|
} |
|
|
|
|
// Nx plugins for webpack.
|
|
|
|
|
module.exports = composePlugins(withNx(), (config) => { |
|
|
|
@ -31,13 +31,13 @@ module.exports = composePlugins(withNx(), (config) => { |
|
|
|
|
readline: false, |
|
|
|
|
child_process: false, |
|
|
|
|
buffer: require.resolve('buffer/'), |
|
|
|
|
vm: require.resolve('vm-browserify') |
|
|
|
|
vm: require.resolve('vm-browserify'), |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// add externals
|
|
|
|
|
config.externals = { |
|
|
|
|
...config.externals, |
|
|
|
|
solc: 'solc' |
|
|
|
|
solc: 'solc', |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// add public path
|
|
|
|
@ -52,7 +52,7 @@ module.exports = composePlugins(withNx(), (config) => { |
|
|
|
|
new webpack.ProvidePlugin({ |
|
|
|
|
Buffer: ['buffer', 'Buffer'], |
|
|
|
|
url: ['url', 'URL'], |
|
|
|
|
process: 'process/browser' |
|
|
|
|
process: 'process/browser', |
|
|
|
|
}) |
|
|
|
|
) |
|
|
|
|
|
|
|
|
@ -60,7 +60,7 @@ module.exports = composePlugins(withNx(), (config) => { |
|
|
|
|
config.module.rules.push({ |
|
|
|
|
test: /\.js$/, |
|
|
|
|
use: ['source-map-loader'], |
|
|
|
|
enforce: 'pre' |
|
|
|
|
enforce: 'pre', |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
config.ignoreWarnings = [/Failed to parse source map/] // ignore source-map-loader warnings
|
|
|
|
@ -74,16 +74,16 @@ module.exports = composePlugins(withNx(), (config) => { |
|
|
|
|
compress: false, |
|
|
|
|
mangle: false, |
|
|
|
|
format: { |
|
|
|
|
comments: false |
|
|
|
|
} |
|
|
|
|
comments: false, |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
extractComments: false |
|
|
|
|
extractComments: false, |
|
|
|
|
}), |
|
|
|
|
new CssMinimizerPlugin() |
|
|
|
|
new CssMinimizerPlugin(), |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
config.watchOptions = { |
|
|
|
|
ignored: /node_modules/ |
|
|
|
|
ignored: /node_modules/, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return config |
|
|
|
|