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

Commit 7f67198

Browse files
authored
feat(TypeScript): use ts-loader instead of awesome-typescript-loader (#738)
We executed some performance tests to compare `ts-loader` and `awesome-typescript-loader`. The difference in the build time between the two is insignificant. On the other hand, the `ts-loader` is 50% smaller than `awesome-typescript-loader` and is a dependency of the `nativescript-dev-webpack` package because it is needed in the {N}-Vue projects anyway.
1 parent 9adc7e7 commit 7f67198

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

demo/TypeScriptApp/webpack.config.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ module.exports = env => {
8888
alias: {
8989
'~': appFullPath
9090
},
91-
// don't resolve symlinks to symlinked modules
92-
symlinks: false
91+
// resolve symlinks to symlinked modules
92+
symlinks: true
9393
},
9494
resolveLoader: {
9595
// don't resolve symlinks to symlinked loaders
@@ -192,10 +192,14 @@ module.exports = env => {
192192
{
193193
test: /\.ts$/,
194194
use: {
195-
loader: "awesome-typescript-loader",
196-
options: { configFileName: "tsconfig.tns.json" },
195+
loader: "ts-loader",
196+
options: {
197+
configFile: "tsconfig.tns.json",
198+
allowTsInNodeModules: true,
199+
},
197200
}
198201
},
202+
199203
]
200204
},
201205
plugins: [

dependencyManager.js

-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ function removeObsoleteDeps(packageJson) {
5757
"uglifyjs-webpack-plugin",
5858
"@angular-devkit/core",
5959
"resolve-url-loader",
60-
"awesome-typescript-loader",
6160
"sass-loader",
6261
];
6362

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@
7575
},
7676
"dependencies": {
7777
"@angular-devkit/core": "~7.1.0",
78-
"awesome-typescript-loader": "~5.2.1",
7978
"clean-webpack-plugin": "~1.0.0",
8079
"copy-webpack-plugin": "~4.6.0",
8180
"css-loader": "~1.0.0",

templates/webpack.typescript.js

+7-4
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ module.exports = env => {
8686
alias: {
8787
'~': appFullPath
8888
},
89-
// don't resolve symlinks to symlinked modules
90-
symlinks: false
89+
// resolve symlinks to symlinked modules
90+
symlinks: true
9191
},
9292
resolveLoader: {
9393
// don't resolve symlinks to symlinked loaders
@@ -190,8 +190,11 @@ module.exports = env => {
190190
{
191191
test: /\.ts$/,
192192
use: {
193-
loader: "awesome-typescript-loader",
194-
options: { configFileName: "tsconfig.tns.json" },
193+
loader: "ts-loader",
194+
options: {
195+
configFile: "tsconfig.tns.json",
196+
allowTsInNodeModules: true,
197+
},
195198
}
196199
},
197200
]

0 commit comments

Comments
 (0)