Skip to content

Commit

Permalink
fix storybook and cypress build, using webpack v4
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-burel committed Oct 1, 2021
1 parent 71b8c41 commit cbbff25
Show file tree
Hide file tree
Showing 3 changed files with 280 additions and 261 deletions.
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@
"@mui/icons-material": "^5.0.0",
"@mui/material": "^5.0.0",
"@next/mdx": "^10.0.2",
"@vulcanjs/demo": "latest",
"@vulcanjs/graphql": "latest",
"@vulcanjs/mdx": "latest",
"@vulcanjs/meteor-legacy": "latest",
"@vulcanjs/mongo": "latest",
"@vulcanjs/react-hooks": "latest",
"@vulcanjs/react-ui": "latest",
"@vulcanjs/demo": "^0.4.0",
"@vulcanjs/graphql": "^0.4.0",
"@vulcanjs/mdx": "^0.4.0",
"@vulcanjs/meteor-legacy": "^0.4.0",
"@vulcanjs/mongo": "^0.4.0",
"@vulcanjs/react-hooks": "^0.4.0",
"@vulcanjs/react-ui": "^0.4.0",
"apollo-server-express": "2.14.2",
"babel-jest": "26.0.1",
"babel-plugin-istanbul": "6.0.0",
Expand Down
16 changes: 10 additions & 6 deletions packages/@vulcanjs/webpack/extendWebpackConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// type Environment = "server" | "client"

const path = require("path");
const webpack = require("webpack");

const withMagicImports = (config = {}) => {
if (!config.resolve) config.resolve = {};
Expand Down Expand Up @@ -59,12 +60,15 @@ const extendWebpackConfig = (environment) => (webpackConfig) => {
// @see https://github.com/angular/angular-cli/issues/20819
// TODO: this is the sign of a server code leak, investigate if still needed
// after we get rid of those leaks (O9/2021)
webpackConfig.resolve.fallback = {
events: false,
path: false,
stream: false,
util: false,
};
const isV5 = webpack.version.match(/5\.\d+\.\d+/);
if (isV5) {
webpackConfig.resolve.fallback = {
events: false,
path: false,
stream: false,
util: false,
};
}

withMagicImports(webpackConfig);
return webpackConfig;
Expand Down
Loading

0 comments on commit cbbff25

Please sign in to comment.