remix-project mirror
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
remix-project/apps/remix-ide/webpack.config.js

39 lines
887 B

const nxWebpack = require('@nrwl/react/plugins/webpack')
const TerserPlugin = require('terser-webpack-plugin')
3 years ago
const CopyWebpackPlugin = require("copy-webpack-plugin");
module.exports = config => {
const nxWebpackConfig = nxWebpack(config)
const webpackConfig = {
...nxWebpackConfig,
node: {
fs: 'empty',
tls: 'empty',
readline: 'empty',
net: 'empty',
module: 'empty',
child_process: 'empty'
3 years ago
},
plugins: [
new CopyWebpackPlugin([
{ from: "node_modules/monaco-editor/min/vs/", to: "assets/js/monaco-editor/vs" },
]),
]
}
if (process.env.NODE_ENV === 'production') {
return {
...webpackConfig,
mode: 'production',
devtool: 'source-map',
optimization: {
minimize: false,
minimizer: [new TerserPlugin()]
}
}
} else {
return webpackConfig
}
}