Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Commit bfb598f

Browse files
committed
refactor: remove {N} extend of AngularCompilerPlugin
1 parent 8b9bc54 commit bfb598f

File tree

8 files changed

+4
-127
lines changed

8 files changed

+4
-127
lines changed

index.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,12 @@ const { existsSync } = require("fs");
44
const { ANDROID_APP_PATH } = require("./androidProjectHelpers");
55
const {
66
getPackageJson,
7-
isAngular,
87
isAndroid,
98
isIos,
109
} = require("./projectHelpers");
1110

1211
Object.assign(exports, require('./plugins'));
1312

14-
exports.loadAdditionalPlugins = function (projectSettings) {
15-
if (isAngular(projectSettings)) {
16-
Object.assign(exports, require('./plugins/angular')(projectSettings.projectDir));
17-
}
18-
}
19-
2013
exports.getAotEntryModule = function (appDirectory) {
2114
verifyEntryModuleDirectory(appDirectory);
2215

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@
7777
"tapable": "1.0.0"
7878
},
7979
"devDependencies": {
80-
"@ngtools/webpack": "~6.0.3",
8180
"@types/node": "^8.0.0",
8281
"conventional-changelog-cli": "^1.3.22",
8382
"source-map-support": "^0.5.0",

plugins/NativeScriptAngularCompilerPlugin.ts

Lines changed: 0 additions & 104 deletions
This file was deleted.

plugins/angular.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

templates/webpack.angular.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const CopyWebpackPlugin = require("copy-webpack-plugin");
88
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
99
const { NativeScriptWorkerPlugin } = require("nativescript-worker-loader/NativeScriptWorkerPlugin");
1010
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
11+
const { AngularCompilerPlugin } = require("@ngtools/webpack");
1112

1213
module.exports = env => {
1314
// Add your custom Activities, Services and other Android app components here.
@@ -21,9 +22,7 @@ module.exports = env => {
2122
throw new Error("You need to provide a target platform!");
2223
}
2324

24-
const platforms = ["ios", "android"];
2525
const projectRoot = __dirname;
26-
nsWebpack.loadAdditionalPlugins({ projectDir: projectRoot });
2726

2827
// Default destination inside platforms/<platform>/...
2928
const dist = resolve(projectRoot, nsWebpack.getAppPath(platform, projectRoot));
@@ -220,15 +219,11 @@ module.exports = env => {
220219
// For instructions on how to set up workers with webpack
221220
// check out https://github.com/nativescript/worker-loader
222221
new NativeScriptWorkerPlugin(),
223-
// AngularCompilerPlugin with augmented NativeScript filesystem to handle platform specific resource resolution.
224-
new nsWebpack.NativeScriptAngularCompilerPlugin({
222+
223+
new AngularCompilerPlugin({
225224
entryModule: resolve(appPath, "app.module#AppModule"),
226225
tsConfigPath: join(__dirname, "tsconfig.esm.json"),
227226
skipCodeGeneration: !aot,
228-
platformOptions: {
229-
platform,
230-
platforms,
231-
},
232227
}),
233228
// Does IPC communication with the {N} CLI to notify events when running in watch mode.
234229
new nsWebpack.WatchStateLoggerPlugin(),

templates/webpack.javascript.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ module.exports = env => {
2323

2424
const platforms = ["ios", "android"];
2525
const projectRoot = __dirname;
26-
nsWebpack.loadAdditionalPlugins({ projectDir: projectRoot });
2726

2827
// Default destination inside platforms/<platform>/...
2928
const dist = resolve(projectRoot, nsWebpack.getAppPath(platform, projectRoot));

templates/webpack.typescript.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ module.exports = env => {
2323

2424
const platforms = ["ios", "android"];
2525
const projectRoot = __dirname;
26-
nsWebpack.loadAdditionalPlugins({ projectDir: projectRoot });
2726

2827
// Default destination inside platforms/<platform>/...
2928
const dist = resolve(projectRoot, nsWebpack.getAppPath(platform, projectRoot));

tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
"skipLibCheck": true
99
},
1010
"files": [
11-
"plugins/NativeScriptAngularCompilerPlugin.ts",
1211
"plugins/PlatformFSPlugin.ts",
1312
"plugins/WatchStateLoggerPlugin.ts"
1413
]
15-
}
14+
}

0 commit comments

Comments
 (0)