diff --git a/webpack/webpack.common.ts b/webpack/webpack.common.ts index 8d433edf39..d8155288cb 100644 --- a/webpack/webpack.common.ts +++ b/webpack/webpack.common.ts @@ -79,6 +79,7 @@ const SCSS_LOADERS = [ export const commonExports = { plugins: [ + // @ts-expect-error: EnvironmentPlugin constructor types are currently to strict see issue https://github.com/webpack/webpack/issues/18719 new EnvironmentPlugin({ languageHashes: getFileHashes(path.join(__dirname, '..', 'src', 'assets', 'i18n'), /.*\.json5/g), }), diff --git a/webpack/webpack.prod.ts b/webpack/webpack.prod.ts index 559b7f1dc7..fce321d152 100644 --- a/webpack/webpack.prod.ts +++ b/webpack/webpack.prod.ts @@ -1,16 +1,17 @@ -import { commonExports } from './webpack.common'; -import { projectRoot } from './helpers'; +import { EnvironmentPlugin } from 'webpack'; -const webpack = require('webpack'); +import { projectRoot } from './helpers'; +import { commonExports } from './webpack.common'; module.exports = Object.assign({}, commonExports, { plugins: [ ...commonExports.plugins, - new webpack.EnvironmentPlugin({ + // @ts-expect-error: EnvironmentPlugin constructor types are currently to strict see issue https://github.com/webpack/webpack/issues/18719 + new EnvironmentPlugin({ 'process.env': { - NODE_ENV: JSON.stringify('production'), - AOT: true - } + NODE_ENV: 'production', + AOT: true, + }, }), ], mode: 'production',