add webpack

pull/3081/head
filip mertens 2 years ago
parent 5ceaef38d2
commit e8f79e05b8
  1. 4
      apps/vyper/tsconfig.json
  2. 31
      apps/vyper/webpack.config.js
  3. 2
      workspace.json

@ -6,8 +6,8 @@
"esModuleInterop": true, "esModuleInterop": true,
"allowSyntheticDefaultImports": true, "allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true, "forceConsistentCasingInFileNames": true,
"strict": true, "strict": false,
"noImplicitReturns": true, "noImplicitReturns": false,
"noFallthroughCasesInSwitch": true "noFallthroughCasesInSwitch": true
}, },
"files": [], "files": [],

@ -0,0 +1,31 @@
const nxWebpack = require('@nrwl/react/plugins/webpack')
const TerserPlugin = require('terser-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'
}
}
if (process.env.NODE_ENV === 'production') {
return {
...webpackConfig,
mode: 'production',
devtool: 'source-map',
optimization: {
minimize: true,
minimizer: [new TerserPlugin()]
}
}
} else {
return webpackConfig
}
}

@ -1540,7 +1540,7 @@
"apps/vyper/src/styles.css" "apps/vyper/src/styles.css"
], ],
"scripts": [], "scripts": [],
"webpackConfig": "@nrwl/react/plugins/webpack" "webpackConfig": "apps/vyper/webpack.config.js"
}, },
"configurations": { "configurations": {
"production": { "production": {

Loading…
Cancel
Save