Skip to content

Commit

Permalink
build: fix EUI dependency (#2147)
Browse files Browse the repository at this point in the history
  • Loading branch information
markov00 committed Aug 24, 2023
1 parent 312c32c commit 3d75220
Show file tree
Hide file tree
Showing 4 changed files with 950 additions and 690 deletions.
12 changes: 10 additions & 2 deletions e2e_server/server/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ module.exports = {
},
},
module: {
// used to skip parsing the EUI used hello-pangea/dnd that contains optional chaining code
noParse: [path.resolve(__dirname, '../../node_modules/@hello-pangea')],
rules: [
{
test: /\.(ttf|eot|woff|woff2|svg)$/,
Expand All @@ -59,6 +57,16 @@ module.exports = {
},
},
},
{
test: /\.js$/,
include: [path.resolve(__dirname, '../../node_modules/@hello-pangea')],
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'],
},
},
},
{
test: /\.tsx?$/,
loader: 'ts-loader',
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@
"ts:prune": "ts-prune"
},
"devDependencies": {
"@babel/core": "^7.10.4",
"@babel/plugin-transform-modules-commonjs": "^7.10.4",
"@babel/preset-env": "^7.10.4",
"@babel/preset-react": "^7.10.4",
"@babel/core": "^7.22.10",
"@babel/plugin-transform-modules-commonjs": "^7.22.5",
"@babel/preset-env": "^7.22.10",
"@babel/preset-react": "^7.22.5",
"@commitlint/cli": "^12.1.1",
"@commitlint/config-conventional": "^12.1.1",
"@elastic/datemath": "^5.0.3",
Expand Down Expand Up @@ -105,6 +105,7 @@
"@types/uuid": "^8.3.4",
"@typescript-eslint/eslint-plugin": "^6.4.0",
"@typescript-eslint/parser": "^6.4.0",
"babel-loader": "^8.3.0",
"autoprefixer": "^9.0.0",
"backport": "^5.6.6",
"commitizen": "^4.2.3",
Expand Down
13 changes: 11 additions & 2 deletions storybook/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,17 @@ module.exports = ({ config }) => {
...scssLoaders,
],
});
// used to skip parsing the EUI used hello-pangea/dnd that contains optional chaining code
config.module.noParse = [path.resolve(__dirname, '../node_modules/@hello-pangea')];
// exception for this library that can't be parsed by webpack4 due to their optional chaining method
config.module.rules.push({
test: /\.js$/,
include: [path.resolve(__dirname, '../node_modules/@hello-pangea/dnd')],
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'],
},
},
});

config.resolve.extensions.push('.ts', '.tsx');

Expand Down
Loading

0 comments on commit 3d75220

Please sign in to comment.