Skip to content

Commit

Permalink
fix: webpack4 fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Jan 14, 2022
1 parent d2543f7 commit 958fa6a
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions integrations/base-integration/src/webpack-build.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import path from 'path';
import fs from 'fs';
import webpack from 'webpack';
import {
BuildProps,
Store,
Expand Down Expand Up @@ -106,20 +107,26 @@ export const webpackConfig = ({
process.cwd(),
getBundleName(buildOptions),
);
return {
const result = {
...config,
resolve: {
...config.resolve,
alias: {
...config.resolve?.alias,
'component-controls-bundle': bundleFilePath,
},
},
};
if (webpack.version > '5') {
result.resolve = {
...result.resolve,
fallback: {
...config.resolve?.fallback,
crypto: false,
},
},
};
};
}
return result;
};

export const asyncWebpackConfig = async (props: {
Expand Down

0 comments on commit 958fa6a

Please sign in to comment.