diff options
Diffstat (limited to 'webpack.config.js')
-rw-r--r-- | webpack.config.js | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/webpack.config.js b/webpack.config.js index 01625988c..098604f1f 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,23 +1,28 @@ +/* eslint-disable node/no-unpublished-require */ const path = require('path'); const webpack = require('webpack'); const CopyWebpackPlugin = require('copy-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); +const { parsed } = require('dotenv').config(); const plugins = [ - new CopyWebpackPlugin([ - { - from: 'deploy', - to: path.join(__dirname, 'build'), - }, - ]), + // new CopyWebpackPlugin({ + // patterns: [ + // { + // from: 'deploy', + // to: path.join(__dirname, 'build'), + // }, + // ], + // }), new HtmlWebpackPlugin({ title: 'Caching', }), new ForkTsCheckerWebpackPlugin({ tslint: true, - // memoryLimit: 4096, + memoryLimit: 4096, useTypescriptIncrementalApi: true, + tslintAutoFix: true, }), new webpack.ProvidePlugin({ Buffer: ['buffer', 'Buffer'] }), new webpack.ProvidePlugin({ process: 'process/browser' }), @@ -26,12 +31,12 @@ const plugins = [ function transferEnvironmentVariables() { const prefix = '_CLIENT_'; - const { parsed } = require('dotenv').config(); if (!parsed) { return; } const resolvedClientSide = Object.keys(parsed).reduce((mapping, envKey) => { if (envKey.startsWith(prefix)) { + // eslint-disable-next-line mapping[`process.env.${envKey.replace(prefix, '')}`] = JSON.stringify(parsed[envKey]); } return mapping; |