mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
chore: webpack config consistency
This commit is contained in:
@ -15,10 +15,6 @@ const { NativeScriptWorkerPlugin } = require('nativescript-worker-loader/NativeS
|
||||
const hashSalt = Date.now().toString();
|
||||
|
||||
module.exports = (env) => {
|
||||
// Add your custom Activities, Services and other android app components here.
|
||||
const appComponents = env.appComponents || [];
|
||||
appComponents.push(...['@nativescript/core/ui/frame', '@nativescript/core/ui/frame/activity']);
|
||||
|
||||
const platform = env && ((env.android && 'android') || (env.ios && 'ios') || env.platform);
|
||||
if (!platform) {
|
||||
throw new Error('You need to provide a target platform!');
|
||||
@ -54,6 +50,8 @@ module.exports = (env) => {
|
||||
snapshotInDocker, // --env.snapshotInDocker
|
||||
skipSnapshotTools, // --env.skipSnapshotTools
|
||||
compileSnapshot, // --env.compileSnapshot
|
||||
appComponents = [],
|
||||
entries = {},
|
||||
} = env;
|
||||
|
||||
const useLibs = compileSnapshot;
|
||||
@ -82,8 +80,7 @@ module.exports = (env) => {
|
||||
|
||||
const entryModule = nsWebpack.getEntryModule(appFullPath, platform);
|
||||
const entryPath = `.${sep}${entryModule}`;
|
||||
const entries = env.entries || {};
|
||||
entries.bundle = entryPath;
|
||||
Object.assign(entries, { bundle: entryPath }, entries);
|
||||
|
||||
const areCoreModulesExternal = Array.isArray(env.externals) && env.externals.some((e) => e.indexOf('@nativescript') > -1);
|
||||
if (platform === 'ios' && !areCoreModulesExternal && !testing) {
|
||||
@ -99,6 +96,9 @@ module.exports = (env) => {
|
||||
itemsToClean.push(`${join(projectRoot, 'platforms', 'android', 'app', 'build', 'configurations', 'nativescript-android-snapshot')}`);
|
||||
}
|
||||
|
||||
// Add your custom Activities, Services and other android app components here.
|
||||
appComponents.push('@nativescript/core/ui/frame', '@nativescript/core/ui/frame/activity');
|
||||
|
||||
nsWebpack.processAppComponents(appComponents, platform);
|
||||
const config = {
|
||||
mode: mode,
|
||||
|
Reference in New Issue
Block a user