Skip to content

Commit 7dea5f7

Browse files
Temporarily ignore type errors from EnvironmentPlugin since type matching is currently too strict
1 parent 81b89f5 commit 7dea5f7

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

webpack/webpack.common.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ const SCSS_LOADERS = [
7979

8080
export const commonExports = {
8181
plugins: [
82+
// @ts-expect-error: EnvironmentPlugin constructor types are currently to strict see issue https://github.com/webpack/webpack/issues/18719
8283
new EnvironmentPlugin({
8384
languageHashes: getFileHashes(path.join(__dirname, '..', 'src', 'assets', 'i18n'), /.*\.json5/g),
8485
}),

webpack/webpack.prod.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
import { commonExports } from './webpack.common';
2-
import { projectRoot } from './helpers';
1+
import { EnvironmentPlugin } from 'webpack';
32

4-
const webpack = require('webpack');
3+
import { projectRoot } from './helpers';
4+
import { commonExports } from './webpack.common';
55

66
module.exports = Object.assign({}, commonExports, {
77
plugins: [
88
...commonExports.plugins,
9-
new webpack.EnvironmentPlugin({
9+
// @ts-expect-error: EnvironmentPlugin constructor types are currently to strict see issue https://github.com/webpack/webpack/issues/18719
10+
new EnvironmentPlugin({
1011
'process.env': {
11-
NODE_ENV: JSON.stringify('production'),
12-
AOT: true
13-
}
12+
NODE_ENV: 'production',
13+
AOT: true,
14+
},
1415
}),
1516
],
1617
mode: 'production',

0 commit comments

Comments
 (0)