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

Commit 7263809

Browse files
committed
refactor: update worker-loader version and add setup instructions
1 parent 3e0f381 commit 7263809

File tree

4 files changed

+17
-16
lines changed

4 files changed

+17
-16
lines changed

dependencyManager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function getRequiredDeps(packageJson) {
6666
"copy-webpack-plugin": "~4.5.1",
6767
"raw-loader": "~0.5.1",
6868
"css-loader": "~0.28.7",
69-
"nativescript-worker-loader": "~0.8.1",
69+
"nativescript-worker-loader": "~0.9.0",
7070
"resolve-url-loader": "~2.3.0",
7171
"extract-text-webpack-plugin": "~3.0.2",
7272
"uglifyjs-webpack-plugin": "~1.2.4",

templates/webpack.angular.js

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ module.exports = env => {
4242
uglify, // --env.uglify
4343
report, // --env.report
4444
} = env;
45-
const ngToolsWebpackOptions = { tsConfigPath: join(__dirname, "tsconfig.esm.json") };
4645

4746
const appFullPath = resolve(projectRoot, appPath);
4847
const appResourcesFullPath = resolve(projectRoot, appResourcesPath);
@@ -179,7 +178,7 @@ module.exports = env => {
179178
{
180179
test: /.ts$/, use: [
181180
"nativescript-dev-webpack/moduleid-compat-loader",
182-
{ loader: "@ngtools/webpack", options: ngToolsWebpackOptions },
181+
"@ngtools/webpack",
183182
]
184183
},
185184

@@ -217,19 +216,19 @@ module.exports = env => {
217216
"./vendor",
218217
"./bundle",
219218
]),
220-
// Support for web workers since v3.2
219+
// For instructions on how to set up workers with webpack
220+
// check out https://github.com/nativescript/worker-loader
221221
new NativeScriptWorkerPlugin(),
222222
// AngularCompilerPlugin with augmented NativeScript filesystem to handle platform specific resource resolution.
223-
new nsWebpack.NativeScriptAngularCompilerPlugin(
224-
Object.assign({
225-
entryModule: resolve(appPath, "app.module#AppModule"),
226-
skipCodeGeneration: !aot,
227-
platformOptions: {
228-
platform,
229-
platforms,
230-
},
231-
}, ngToolsWebpackOptions)
232-
),
223+
new nsWebpack.NativeScriptAngularCompilerPlugin({
224+
entryModule: resolve(appPath, "app.module#AppModule"),
225+
tsConfigPath: join(__dirname, "tsconfig.esm.json"),
226+
skipCodeGeneration: !aot,
227+
platformOptions: {
228+
platform,
229+
platforms,
230+
},
231+
}),
233232
// Does IPC communication with the {N} CLI to notify events when running in watch mode.
234233
new nsWebpack.WatchStateLoggerPlugin(),
235234
],

templates/webpack.javascript.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,8 @@ module.exports = env => {
193193
"./vendor",
194194
"./bundle",
195195
]),
196-
// Support for web workers since v3.2
196+
// For instructions on how to set up workers with webpack
197+
// check out https://github.com/nativescript/worker-loader
197198
new NativeScriptWorkerPlugin(),
198199
new nsWebpack.PlatformFSPlugin({
199200
platform,

templates/webpack.typescript.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,8 @@ module.exports = env => {
203203
"./vendor",
204204
"./bundle",
205205
]),
206-
// Support for web workers since v3.2
206+
// For instructions on how to set up workers with webpack
207+
// check out https://github.com/nativescript/worker-loader
207208
new NativeScriptWorkerPlugin(),
208209
new nsWebpack.PlatformFSPlugin({
209210
platform,

0 commit comments

Comments
 (0)