| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent e95287d commit 69ace1e
17 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,12 +5,11 @@ | |||
| 5 | 5 | // compile 'com.android.support:recyclerview-v7:+' | |
| 6 | 6 | //} | |
| 7 | 7 | ||
| 8 | - android { | ||
| 9 | - defaultConfig { | ||
| 8 | + android { | ||
| 9 | + defaultConfig { | ||
| 10 | 10 | generatedDensities = [] | |
| 11 | - applicationId = "org.nativescript.AngularApp" | ||
| 12 | - } | ||
| 13 | - aaptOptions { | ||
| 14 | - additionalParameters "--no-version-vectors" | ||
| 15 | - } | ||
| 16 | - } | ||
| 11 | + } | ||
| 12 | + aaptOptions { | ||
| 13 | + additionalParameters "--no-version-vectors" | ||
| 14 | + } | ||
| 15 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,8 +1,9 @@ | |||
| 1 | 1 | { | |
| 2 | 2 | "android": { | |
| 3 | - "v8Flags": "--expose_gc" | ||
| 3 | + "v8Flags": "--expose_gc", | ||
| 4 | + "markingMode": "none" | ||
| 4 | 5 | }, | |
| 5 | 6 | "main": "main.js", | |
| 6 | 7 | "name": "tns-template-hello-world-ng", | |
| 7 | 8 | "version": "3.3.0" | |
| 8 | - } | ||
| 9 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,13 @@ | |||
| 1 | + const webpackConfig = require("./webpack.config"); | ||
| 2 | + const path = require("path"); | ||
| 3 | + | ||
| 4 | + module.exports = env => { | ||
| 5 | + env = env || {}; | ||
| 6 | + env.appComponents = env.appComponents || []; | ||
| 7 | + env.appComponents.push(path.resolve(__dirname, "app/activity.android.ts")); | ||
| 8 | + | ||
| 9 | + env.entries = env.entries || {}; | ||
| 10 | + env.entries.application = "./application.android"; | ||
| 11 | + const config = webpackConfig(env); | ||
| 12 | + return config; | ||
| 13 | + }; | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,3 @@ | |||
| 1 | + { | ||
| 2 | + "webpackConfigPath": "custom-application-activity.webpack.config.js" | ||
| 3 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,11 +18,11 @@ const hashSalt = Date.now().toString(); | |||
| 18 | 18 | ||
| 19 | 19 | module.exports = env => { | |
| 20 | 20 | // Add your custom Activities, Services and other Android app components here. | |
| 21 | - const appComponents = [ | ||
| 21 | + const appComponents = env.appComponents || []; | ||
| 22 | + appComponents.push(...[ | ||
| 22 | 23 | "tns-core-modules/ui/frame", | |
| 23 | 24 | "tns-core-modules/ui/frame/activity", | |
| 24 | - resolve(__dirname, "app/activity.android.ts") | ||
| 25 | - ]; | ||
| 25 | + ]); | ||
| 26 | 26 | ||
| 27 | 27 | const platform = env && (env.android && "android" || env.ios && "ios"); | |
| 28 | 28 | if (!platform) { | |
@@ -66,9 +66,8 @@ module.exports = env => { | |||
| 66 | 66 | const hasRootLevelScopedModules = nsWebpack.hasRootLevelScopedModules({ projectDir: projectRoot }); | |
| 67 | 67 | const hasRootLevelScopedAngular = nsWebpack.hasRootLevelScopedAngular({ projectDir: projectRoot }); | |
| 68 | 68 | let coreModulesPackageName = "tns-core-modules"; | |
| 69 | - const alias = { | ||
| 70 | - '~': appFullPath | ||
| 71 | - }; | ||
| 69 | + const alias = env.alias || {}; | ||
| 70 | + alias['~'] = appFullPath; | ||
| 72 | 71 | ||
| 73 | 72 | const compilerOptions = getCompilerOptionsFromTSConfig(tsConfigPath); | |
| 74 | 73 | if (hasRootLevelScopedModules) { | |
@@ -85,7 +84,9 @@ module.exports = env => { | |||
| 85 | 84 | const appResourcesFullPath = resolve(projectRoot, appResourcesPath); | |
| 86 | 85 | const entryModule = `${nsWebpack.getEntryModule(appFullPath, platform)}.ts`; | |
| 87 | 86 | const entryPath = `.${sep}${entryModule}`; | |
| 88 | - const entries = { bundle: entryPath, application: "./application.android" }; | ||
| 87 | + const entries = env.entries || {}; | ||
| 88 | + entries.bundle = entryPath; | ||
| 89 | + | ||
| 89 | 90 | const areCoreModulesExternal = Array.isArray(env.externals) && env.externals.some(e => e.indexOf("tns-core-modules") > -1); | |
| 90 | 91 | if (platform === "ios" && !areCoreModulesExternal) { | |
| 91 | 92 | entries["tns_modules/tns-core-modules/inspector_modules"] = "inspector_modules"; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,8 +1,9 @@ | |||
| 1 | 1 | { | |
| 2 | 2 | "android": { | |
| 3 | - "v8Flags": "--expose_gc" | ||
| 3 | + "v8Flags": "--expose_gc", | ||
| 4 | + "markingMode": "none" | ||
| 4 | 5 | }, | |
| 5 | 6 | "main": "app.js", | |
| 6 | 7 | "name": "tns-template-hello-world", | |
| 7 | 8 | "version": "3.3.0" | |
| 8 | - } | ||
| 9 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,13 @@ | |||
| 1 | + const webpackConfig = require("./webpack.config"); | ||
| 2 | + const path = require("path"); | ||
| 3 | + | ||
| 4 | + module.exports = env => { | ||
| 5 | + env = env || {}; | ||
| 6 | + env.appComponents = env.appComponents || []; | ||
| 7 | + env.appComponents.push(path.resolve(__dirname, "app/activity.android.js")); | ||
| 8 | + | ||
| 9 | + env.entries = env.entries || {}; | ||
| 10 | + env.entries.application = "./application.android"; | ||
| 11 | + const config = webpackConfig(env); | ||
| 12 | + return config; | ||
| 13 | + }; | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,3 @@ | |||
| 1 | + { | ||
| 2 | + "webpackConfigPath": "./custom-application-activity.webpack.config.js" | ||
| 3 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,11 +12,11 @@ const hashSalt = Date.now().toString(); | |||
| 12 | 12 | ||
| 13 | 13 | module.exports = env => { | |
| 14 | 14 | // Add your custom Activities, Services and other android app components here. | |
| 15 | - const appComponents = [ | ||
| 15 | + const appComponents = env.appComponents || []; | ||
| 16 | + appComponents.push(...[ | ||
| 16 | 17 | "tns-core-modules/ui/frame", | |
| 17 | 18 | "tns-core-modules/ui/frame/activity", | |
| 18 | - resolve(__dirname, "app/activity.android.js") | ||
| 19 | - ]; | ||
| 19 | + ]); | ||
| 20 | 20 | ||
| 21 | 21 | const platform = env && (env.android && "android" || env.ios && "ios"); | |
| 22 | 22 | if (!platform) { | |
@@ -56,9 +56,8 @@ module.exports = env => { | |||
| 56 | 56 | const appFullPath = resolve(projectRoot, appPath); | |
| 57 | 57 | const hasRootLevelScopedModules = nsWebpack.hasRootLevelScopedModules({ projectDir: projectRoot }); | |
| 58 | 58 | let coreModulesPackageName = "tns-core-modules"; | |
| 59 | - const alias = { | ||
| 60 | - '~': appFullPath | ||
| 61 | - }; | ||
| 59 | + const alias = env.alias || {}; | ||
| 60 | + alias['~'] = appFullPath; | ||
| 62 | 61 | ||
| 63 | 62 | if (hasRootLevelScopedModules) { | |
| 64 | 63 | coreModulesPackageName = "@nativescript/core"; | |
@@ -68,7 +67,9 @@ module.exports = env => { | |||
| 68 | 67 | ||
| 69 | 68 | const entryModule = nsWebpack.getEntryModule(appFullPath, platform); | |
| 70 | 69 | const entryPath = `.${sep}${entryModule}.js`; | |
| 71 | - const entries = { bundle: entryPath, application: "./application.android" }; | ||
| 70 | + const entries = env.entries || {}; | ||
| 71 | + entries.bundle = entryPath; | ||
| 72 | + | ||
| 72 | 73 | const areCoreModulesExternal = Array.isArray(env.externals) && env.externals.some(e => e.indexOf("tns-core-modules") > -1); | |
| 73 | 74 | if (platform === "ios" && !areCoreModulesExternal) { | |
| 74 | 75 | entries["tns_modules/tns-core-modules/inspector_modules"] = "inspector_modules"; | |
@@ -82,6 +83,7 @@ module.exports = env => { | |||
| 82 | 83 | itemsToClean.push(`${join(projectRoot, "platforms", "android", "app", "build", "configurations", "nativescript-android-snapshot")}`); | |
| 83 | 84 | } | |
| 84 | 85 | ||
| 86 | + | ||
| 85 | 87 | nsWebpack.processAppComponents(appComponents, platform); | |
| 86 | 88 | const config = { | |
| 87 | 89 | mode: production ? "production" : "development", | |
@@ -109,6 +111,8 @@ module.exports = env => { | |||
| 109 | 111 | extensions: [".js", ".scss", ".css"], | |
| 110 | 112 | // Resolve {N} system modules from tns-core-modules | |
| 111 | 113 | modules: [ | |
| 114 | + resolve(__dirname, `node_modules/${coreModulesPackageName}`), | ||
| 115 | + resolve(__dirname, "node_modules"), | ||
| 112 | 116 | `node_modules/${coreModulesPackageName}`, | |
| 113 | 117 | "node_modules", | |
| 114 | 118 | ], | |
@@ -272,4 +276,4 @@ module.exports = env => { | |||
| 272 | 276 | ||
| 273 | 277 | ||
| 274 | 278 | return config; | |
| 275 | - }; | ||
| 279 | + }; | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,8 +1,9 @@ | |||
| 1 | 1 | { | |
| 2 | 2 | "android": { | |
| 3 | - "v8Flags": "--expose_gc" | ||
| 3 | + "v8Flags": "--expose_gc", | ||
| 4 | + "markingMode": "none" | ||
| 4 | 5 | }, | |
| 5 | 6 | "main": "app.js", | |
| 6 | 7 | "name": "tns-template-hello-world-ts", | |
| 7 | 8 | "version": "3.3.0" | |
| 8 | - } | ||
| 9 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments