mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-25 19:48:11 +00:00
[js/web] disable node fallback in webpack (#16166)
### Description disable webpack's polyfill for node's `global`, `__filename` and `__dirname` in web build. This will confuse emscripten generated environment detection. see https://webpack.js.org/configuration/node/
This commit is contained in:
parent
13d6ac74de
commit
f67f7c0f0b
1 changed files with 5 additions and 3 deletions
|
|
@ -49,7 +49,7 @@ function defaultTerserPluginOptions(target) {
|
|||
passes: 2
|
||||
},
|
||||
mangle: {
|
||||
reserved: ["_scriptDir","startWorker"]
|
||||
reserved: ["_scriptDir", "startWorker"]
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
@ -111,6 +111,7 @@ function buildConfig({ filename, format, target, mode, devtool, build_defs }) {
|
|||
}]
|
||||
},
|
||||
mode,
|
||||
node: false,
|
||||
devtool
|
||||
};
|
||||
|
||||
|
|
@ -268,8 +269,9 @@ function buildTestRunnerConfig({
|
|||
type: 'asset/source'
|
||||
}]
|
||||
},
|
||||
mode: mode,
|
||||
devtool: devtool,
|
||||
mode,
|
||||
node: false,
|
||||
devtool,
|
||||
};
|
||||
|
||||
if (mode === 'production') {
|
||||
|
|
|
|||
Loading…
Reference in a new issue