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

Commit

Permalink
feat: add support for web workers to default template (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
sis0k0 authored Sep 8, 2017
1 parent 2ce3780 commit 494ccbb
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions dependencyManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ function getRequiredDeps(packageJson) {
"copy-webpack-plugin": "~4.0.1",
"raw-loader": "~0.5.1",
"nativescript-css-loader": "~0.26.0",
"nativescript-worker-loader": "~0.8.1",
"resolve-url-loader": "~2.1.0",
"extract-text-webpack-plugin": "~3.0.0",
};
Expand Down
1 change: 1 addition & 0 deletions prepublish/common/imports.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ const nativescriptTarget = require("nativescript-dev-webpack/nativescript-target
const CopyWebpackPlugin = require("copy-webpack-plugin");
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
const { NativeScriptWorkerPlugin } = require("nativescript-worker-loader/NativeScriptWorkerPlugin");
`;
3 changes: 3 additions & 0 deletions prepublish/common/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ module.exports = `
"./vendor",
"./bundle",
]),
// Support for web workers since v3.2
new NativeScriptWorkerPlugin(),
// Generate report files for bundles content
new BundleAnalyzerPlugin({
Expand Down
4 changes: 4 additions & 0 deletions templates/webpack.angular.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const nativescriptTarget = require("nativescript-dev-webpack/nativescript-target
const CopyWebpackPlugin = require("copy-webpack-plugin");
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
const { NativeScriptWorkerPlugin } = require("nativescript-worker-loader/NativeScriptWorkerPlugin");

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

Expand Down Expand Up @@ -175,6 +176,9 @@ function getPlugins(platform, env) {
"./vendor",
"./bundle",
]),

// Support for web workers since v3.2
new NativeScriptWorkerPlugin(),

// Generate report files for bundles content
new BundleAnalyzerPlugin({
Expand Down
4 changes: 4 additions & 0 deletions templates/webpack.javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const nativescriptTarget = require("nativescript-dev-webpack/nativescript-target
const CopyWebpackPlugin = require("copy-webpack-plugin");
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
const { NativeScriptWorkerPlugin } = require("nativescript-worker-loader/NativeScriptWorkerPlugin");


const mainSheet = `app.css`;
Expand Down Expand Up @@ -159,6 +160,9 @@ function getPlugins(platform, env) {
"./vendor",
"./bundle",
]),

// Support for web workers since v3.2
new NativeScriptWorkerPlugin(),

// Generate report files for bundles content
new BundleAnalyzerPlugin({
Expand Down
4 changes: 4 additions & 0 deletions templates/webpack.typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const nativescriptTarget = require("nativescript-dev-webpack/nativescript-target
const CopyWebpackPlugin = require("copy-webpack-plugin");
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
const { NativeScriptWorkerPlugin } = require("nativescript-worker-loader/NativeScriptWorkerPlugin");


const mainSheet = `app.css`;
Expand Down Expand Up @@ -168,6 +169,9 @@ function getPlugins(platform, env) {
"./vendor",
"./bundle",
]),

// Support for web workers since v3.2
new NativeScriptWorkerPlugin(),

// Generate report files for bundles content
new BundleAnalyzerPlugin({
Expand Down

0 comments on commit 494ccbb

Please sign in to comment.