mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
feat(webpack): auto enable commonjs on core < 9 + consider prereleases
This commit is contained in:
@@ -48,9 +48,12 @@ export default function (config: Config, env: IWebpackEnv = _env): Config {
|
|||||||
// v9+ supports ESM output, anything below uses CommonJS
|
// v9+ supports ESM output, anything below uses CommonJS
|
||||||
if (hasDependency('@nativescript/core')) {
|
if (hasDependency('@nativescript/core')) {
|
||||||
const coreVersion = getDependencyVersion('@nativescript/core');
|
const coreVersion = getDependencyVersion('@nativescript/core');
|
||||||
if (coreVersion && !satisfies(coreVersion, '>=9.0.0')) {
|
// ensure alpha/beta/rc versions are considered as well
|
||||||
// @nativescript/core < 9.0.0 uses CommonJS output
|
if (coreVersion && !coreVersion.includes('9.0.0')) {
|
||||||
env.commonjs = true;
|
if (!satisfies(coreVersion, '>=9.0.0')) {
|
||||||
|
// @nativescript/core < 9.0.0 uses CommonJS output
|
||||||
|
env.commonjs = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user