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

Commit 0386721

Browse files
committed
fix: watch platform specific files from node_modules
Rel to: NativeScript/nativescript-cli#4480
1 parent 58f3f66 commit 0386721

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"copy-webpack-plugin": "~4.6.0",
4545
"css-loader": "~2.1.1",
4646
"fork-ts-checker-webpack-plugin": "1.3.0",
47+
"extra-watch-webpack-plugin": "1.0.3",
4748
"global-modules-path": "2.0.0",
4849
"minimatch": "3.0.4",
4950
"nativescript-hook": "0.2.4",

templates/webpack.javascript.js

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const nsWebpack = require("nativescript-dev-webpack");
55
const nativescriptTarget = require("nativescript-dev-webpack/nativescript-target");
66
const CleanWebpackPlugin = require("clean-webpack-plugin");
77
const CopyWebpackPlugin = require("copy-webpack-plugin");
8+
const ExtraWatchWebpackPlugin = require('extra-watch-webpack-plugin');
89
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
910
const { NativeScriptWorkerPlugin } = require("nativescript-worker-loader/NativeScriptWorkerPlugin");
1011
const TerserPlugin = require("terser-webpack-plugin");
@@ -233,6 +234,9 @@ module.exports = env => {
233234
}),
234235
// Does IPC communication with the {N} CLI to notify events when running in watch mode.
235236
new nsWebpack.WatchStateLoggerPlugin(),
237+
new ExtraWatchWebpackPlugin({
238+
files: [`node_modules/**/*.${platform}.js`]
239+
})
236240
],
237241
};
238242

templates/webpack.typescript.js

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const nativescriptTarget = require("nativescript-dev-webpack/nativescript-target
66
const CleanWebpackPlugin = require("clean-webpack-plugin");
77
const CopyWebpackPlugin = require("copy-webpack-plugin");
88
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
9+
const ExtraWatchWebpackPlugin = require('extra-watch-webpack-plugin');
910
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
1011
const { NativeScriptWorkerPlugin } = require("nativescript-worker-loader/NativeScriptWorkerPlugin");
1112
const TerserPlugin = require("terser-webpack-plugin");
@@ -263,6 +264,9 @@ module.exports = env => {
263264
async: false,
264265
useTypescriptIncrementalApi: true,
265266
memoryLimit: 4096
267+
}),
268+
new ExtraWatchWebpackPlugin({
269+
files: [`node_modules/**/*.${platform}.ts`]
266270
})
267271
],
268272
};

templates/webpack.vue.js

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const { join, relative, resolve, sep } = require("path");
33
const webpack = require("webpack");
44
const CleanWebpackPlugin = require("clean-webpack-plugin");
55
const CopyWebpackPlugin = require("copy-webpack-plugin");
6+
const ExtraWatchWebpackPlugin = require('extra-watch-webpack-plugin');
67
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
78
const TerserPlugin = require("terser-webpack-plugin");
89

@@ -257,6 +258,9 @@ module.exports = env => {
257258
}),
258259
// Does IPC communication with the {N} CLI to notify events when running in watch mode.
259260
new nsWebpack.WatchStateLoggerPlugin(),
261+
new ExtraWatchWebpackPlugin({
262+
files: [`node_modules/**/*.${platform}.ts`, `node_modules/**/*.${platform}.js`]
263+
})
260264
],
261265
};
262266

0 commit comments

Comments
 (0)