Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions templates/webpack.angular.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ module.exports = env => {

const entryModule = `${nsWebpack.getEntryModule(appFullPath)}.ts`;
const entryPath = `.${sep}${entryModule}`;
const entries = { bundle: entryPath };
if (platform === "ios") {
entries["tns_modules/tns-core-modules/inspector_modules"] = "inspector_modules.js";
};

const ngCompilerTransformers = [];
const additionalLazyModuleResources = [];
if (aot) {
Expand Down Expand Up @@ -100,9 +105,7 @@ module.exports = env => {
]
},
target: nativescriptTarget,
entry: {
bundle: entryPath,
},
entry: entries,
output: {
pathinfo: false,
path: dist,
Expand Down Expand Up @@ -137,6 +140,7 @@ module.exports = env => {
},
devtool: sourceMap ? "inline-source-map" : "none",
optimization: {
runtimeChunk: "single",
splitChunks: {
cacheGroups: {
vendor: {
Expand Down Expand Up @@ -254,10 +258,16 @@ module.exports = env => {
{ from: { glob: "**/*.png" } },
], { ignore: [`${relative(appPath, appResourcesFullPath)}/**`] }),
// Generate a bundle starter script and activate it in package.json
new nsWebpack.GenerateBundleStarterPlugin([
"./vendor",
"./bundle",
]),
new nsWebpack.GenerateBundleStarterPlugin(
// Don't include `runtime.js` when creating a snapshot. The plugin
// configures the WebPack runtime to be generated inside the snapshot
// module and no `runtime.js` module exist.
(snapshot ? [] : ["./runtime"])
.concat([
"./vendor",
"./bundle",
])
),
// For instructions on how to set up workers with webpack
// check out https://github.com/nativescript/worker-loader
new NativeScriptWorkerPlugin(),
Expand Down
25 changes: 17 additions & 8 deletions templates/webpack.javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ module.exports = env => {

const entryModule = nsWebpack.getEntryModule(appFullPath);
const entryPath = `.${sep}${entryModule}.js`;
const entries = { bundle: entryPath };
if (platform === "ios") {
entries["tns_modules/tns-core-modules/inspector_modules"] = "inspector_modules.js";
};

const config = {
mode: uglify ? "production" : "development",
Expand All @@ -62,9 +66,7 @@ module.exports = env => {
]
},
target: nativescriptTarget,
entry: {
bundle: entryPath,
},
entry: entries,
output: {
pathinfo: false,
path: dist,
Expand Down Expand Up @@ -98,7 +100,8 @@ module.exports = env => {
"__dirname": false,
},
devtool: sourceMap ? "inline-source-map" : "none",
optimization: {
optimization: {
runtimeChunk: "single",
splitChunks: {
cacheGroups: {
vendor: {
Expand Down Expand Up @@ -207,10 +210,16 @@ module.exports = env => {
{ from: { glob: "**/*.png" } },
], { ignore: [`${relative(appPath, appResourcesFullPath)}/**`] }),
// Generate a bundle starter script and activate it in package.json
new nsWebpack.GenerateBundleStarterPlugin([
"./vendor",
"./bundle",
]),
new nsWebpack.GenerateBundleStarterPlugin(
// Don't include `runtime.js` when creating a snapshot. The plugin
// configures the WebPack runtime to be generated inside the snapshot
// module and no `runtime.js` module exist.
(snapshot ? [] : ["./runtime"])
.concat([
"./vendor",
"./bundle",
])
),
// For instructions on how to set up workers with webpack
// check out https://github.com/nativescript/worker-loader
new NativeScriptWorkerPlugin(),
Expand Down
25 changes: 17 additions & 8 deletions templates/webpack.typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ module.exports = env => {

const entryModule = nsWebpack.getEntryModule(appFullPath);
const entryPath = `.${sep}${entryModule}.ts`;
const entries = { bundle: entryPath };
if (platform === "ios") {
entries["tns_modules/tns-core-modules/inspector_modules"] = "inspector_modules.js";
};

const config = {
mode: uglify ? "production" : "development",
Expand All @@ -62,9 +66,7 @@ module.exports = env => {
]
},
target: nativescriptTarget,
entry: {
bundle: entryPath,
},
entry: entries,
output: {
pathinfo: false,
path: dist,
Expand Down Expand Up @@ -100,7 +102,8 @@ module.exports = env => {
"__dirname": false,
},
devtool: sourceMap ? "inline-source-map" : "none",
optimization: {
optimization: {
runtimeChunk: "single",
splitChunks: {
cacheGroups: {
vendor: {
Expand Down Expand Up @@ -220,10 +223,16 @@ module.exports = env => {
{ from: { glob: "**/*.png" } },
], { ignore: [`${relative(appPath, appResourcesFullPath)}/**`] }),
// Generate a bundle starter script and activate it in package.json
new nsWebpack.GenerateBundleStarterPlugin([
"./vendor",
"./bundle",
]),
new nsWebpack.GenerateBundleStarterPlugin(
// Don't include `runtime.js` when creating a snapshot. The plugin
// configures the WebPack runtime to be generated inside the snapshot
// module and no `runtime.js` module exist.
(snapshot ? [] : ["./runtime"])
.concat([
"./vendor",
"./bundle",
])
),
// For instructions on how to set up workers with webpack
// check out https://github.com/nativescript/worker-loader
new NativeScriptWorkerPlugin(),
Expand Down
23 changes: 16 additions & 7 deletions templates/webpack.vue.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ module.exports = env => {

const entryModule = nsWebpack.getEntryModule(appFullPath);
const entryPath = `.${sep}${entryModule}`;
const entries = { bundle: entryPath };
if (platform === "ios") {
entries["tns_modules/tns-core-modules/inspector_modules"] = "inspector_modules.js";
};
console.log(`Bundling application for entryPath ${entryPath}...`);

const config = {
Expand All @@ -70,9 +74,7 @@ module.exports = env => {
},
target: nativescriptTarget,
// target: nativeScriptVueTarget,
entry: {
bundle: entryPath,
},
entry: entries,
output: {
pathinfo: false,
path: dist,
Expand Down Expand Up @@ -111,6 +113,7 @@ module.exports = env => {
},
devtool: "none",
optimization: {
runtimeChunk: "single",
splitChunks: {
cacheGroups: {
vendor: {
Expand Down Expand Up @@ -227,10 +230,16 @@ module.exports = env => {
{ from: { glob: "assets/**/*" } },
], { ignore: [`${relative(appPath, appResourcesFullPath)}/**`] }),
// Generate a bundle starter script and activate it in package.json
new nsWebpack.GenerateBundleStarterPlugin([
"./vendor",
"./bundle",
]),
new nsWebpack.GenerateBundleStarterPlugin(
// Don't include `runtime.js` when creating a snapshot. The plugin
// configures the WebPack runtime to be generated inside the snapshot
// module and no `runtime.js` module exist.
(snapshot ? [] : ["./runtime"])
.concat([
"./vendor",
"./bundle",
])
),
// For instructions on how to set up workers with webpack
// check out https://github.com/nativescript/worker-loader
new NativeScriptWorkerPlugin(),
Expand Down