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

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion prepublish/angular/imports.js
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
module.exports = `const { AotPlugin } = require("@ngtools/webpack");`;
module.exports = `const { AotPlugin } = require("@ngtools/webpack");

const ngToolsWebpackOptions = { tsConfigPath: "tsconfig.aot.json" };`;
11 changes: 6 additions & 5 deletions prepublish/angular/plugins.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
module.exports = `
// Angular AOT compiler
new AotPlugin({
tsConfigPath: "tsconfig.aot.json",
entryModule: resolve(__dirname, "app/app.module#AppModule"),
typeChecking: false
}),
new AotPlugin(
Object.assign({
entryModule: resolve(__dirname, "app/app.module#AppModule"),
typeChecking: false
}, ngToolsWebpackOptions)
),

// Resolve .ios.css and .android.css component stylesheets, and .ios.html and .android component views
new nsWebpack.UrlResolvePlugin({
Expand Down
13 changes: 8 additions & 5 deletions prepublish/angular/rules.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
module.exports = `
// Compile TypeScript files with ahead-of-time compiler.
{
test: /\\.ts$/,
loaders: [
"nativescript-dev-webpack/tns-aot-loader",
"@ngtools/webpack",
test: /\.ts$/,
use: [
{ loader: "nativescript-dev-webpack/tns-aot-loader" },
{
loader: "@ngtools/webpack",
options: ngToolsWebpackOptions,
},
]
}
},
`;
26 changes: 16 additions & 10 deletions templates/webpack.angular.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");

const { AotPlugin } = require("@ngtools/webpack");

const ngToolsWebpackOptions = { tsConfigPath: "tsconfig.aot.json" };

const mainSheet = `app.css`;

module.exports = env => {
Expand Down Expand Up @@ -131,12 +133,15 @@ function getRules() {

// Compile TypeScript files with ahead-of-time compiler.
{
test: /\.ts$/,
loaders: [
"nativescript-dev-webpack/tns-aot-loader",
"@ngtools/webpack",
test: /.ts$/,
use: [
{ loader: "nativescript-dev-webpack/tns-aot-loader" },
{
loader: "@ngtools/webpack",
options: ngToolsWebpackOptions,
},
]
}
},

];
}
Expand Down Expand Up @@ -181,11 +186,12 @@ function getPlugins(platform, env) {
}),

// Angular AOT compiler
new AotPlugin({
tsConfigPath: "tsconfig.aot.json",
entryModule: resolve(__dirname, "app/app.module#AppModule"),
typeChecking: false
}),
new AotPlugin(
Object.assign({
entryModule: resolve(__dirname, "app/app.module#AppModule"),
typeChecking: false
}, ngToolsWebpackOptions)
),

// Resolve .ios.css and .android.css component stylesheets, and .ios.html and .android component views
new nsWebpack.UrlResolvePlugin({
Expand Down