fix: don't externalize node built-ins

This commit is contained in:
Igor Randjelovic
2021-04-14 14:58:44 +02:00
parent 0f5b127c1a
commit f053403d8d
8 changed files with 57 additions and 0 deletions

View File

@ -44,6 +44,15 @@ export default function (config: Config, env: IWebpackEnv = _env): Config {
// resolved at runtime
config.externals(['package.json', '~/package.json']);
// disable marking built-in node modules as external
// since they are not available at runtime and
// should be bundled (requires polyfills)
// for example `npm i --save url` to
// polyfill the node url module.
config.set('externalsPresets', {
node: false,
});
const getSourceMapType = (map: string | boolean): Config.DevTool => {
const defaultSourceMap = 'inline-source-map';