From e8f79e05b8a60ecedf83a63f3de06b87aab2192c Mon Sep 17 00:00:00 2001 From: filip mertens Date: Thu, 3 Nov 2022 14:03:12 +0100 Subject: [PATCH] add webpack --- apps/vyper/tsconfig.json | 4 ++-- apps/vyper/webpack.config.js | 31 +++++++++++++++++++++++++++++++ workspace.json | 2 +- 3 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 apps/vyper/webpack.config.js diff --git a/apps/vyper/tsconfig.json b/apps/vyper/tsconfig.json index a3e71f89f3..89dc063037 100644 --- a/apps/vyper/tsconfig.json +++ b/apps/vyper/tsconfig.json @@ -6,8 +6,8 @@ "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "strict": true, - "noImplicitReturns": true, + "strict": false, + "noImplicitReturns": false, "noFallthroughCasesInSwitch": true }, "files": [], diff --git a/apps/vyper/webpack.config.js b/apps/vyper/webpack.config.js new file mode 100644 index 0000000000..02143af15b --- /dev/null +++ b/apps/vyper/webpack.config.js @@ -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 + } +} diff --git a/workspace.json b/workspace.json index 0e292d14ea..4fbdc876ae 100644 --- a/workspace.json +++ b/workspace.json @@ -1540,7 +1540,7 @@ "apps/vyper/src/styles.css" ], "scripts": [], - "webpackConfig": "@nrwl/react/plugins/webpack" + "webpackConfig": "apps/vyper/webpack.config.js" }, "configurations": { "production": {