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