Skip to content

Commit

Permalink
Temporarily ignore type errors from EnvironmentPlugin since type matc…
Browse files Browse the repository at this point in the history
…hing is currently too strict
  • Loading branch information
alexandrevryghem committed Aug 30, 2024
1 parent 81b89f5 commit 7dea5f7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions webpack/webpack.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}),
Expand Down
15 changes: 8 additions & 7 deletions webpack/webpack.prod.ts
Original file line number Diff line number Diff line change
@@ -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',
Expand Down

0 comments on commit 7dea5f7

Please sign in to comment.