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

Commit ba080fa

Browse files
committed
fix: watch platform specific files from node_modules
Rel to: NativeScript/nativescript-cli#4480
1 parent 41bc142 commit ba080fa

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
@@ -43,6 +43,7 @@
4343
"clean-webpack-plugin": "~1.0.0",
4444
"copy-webpack-plugin": "~4.6.0",
4545
"css-loader": "~2.1.1",
46+
"extra-watch-webpack-plugin": "1.0.3",
4647
"global-modules-path": "2.0.0",
4748
"minimatch": "3.0.4",
4849
"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");
@@ -242,6 +243,9 @@ module.exports = env => {
242243
}),
243244
// Does IPC communication with the {N} CLI to notify events when running in watch mode.
244245
new nsWebpack.WatchStateLoggerPlugin(),
246+
new ExtraWatchWebpackPlugin({
247+
files: [`node_modules/**/*.${platform}.js`]
248+
})
245249
],
246250
};
247251

templates/webpack.typescript.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");
@@ -258,6 +259,9 @@ module.exports = env => {
258259
}),
259260
// Does IPC communication with the {N} CLI to notify events when running in watch mode.
260261
new nsWebpack.WatchStateLoggerPlugin(),
262+
new ExtraWatchWebpackPlugin({
263+
files: [`node_modules/**/*.${platform}.ts`]
264+
})
261265
],
262266
};
263267

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

@@ -264,6 +265,9 @@ module.exports = env => {
264265
}),
265266
// Does IPC communication with the {N} CLI to notify events when running in watch mode.
266267
new nsWebpack.WatchStateLoggerPlugin(),
268+
new ExtraWatchWebpackPlugin({
269+
files: [`node_modules/**/*.${platform}.ts`, `node_modules/**/*.${platform}.js`]
270+
})
267271
],
268272
};
269273

0 commit comments

Comments
 (0)