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

chore: merge release in master #833

Merged
merged 8 commits into from
Mar 15, 2019
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
<a name="0.20.3"></a>
## [0.20.3](https://github.com/NativeScript/nativescript-dev-webpack/compare/0.20.2...0.20.3) (2019-03-14)


### Bug Fixes

* initial compilation always generates same compilation hash ([#815](https://github.com/NativeScript/nativescript-dev-webpack/issues/815)) ([ba6d896](https://github.com/NativeScript/nativescript-dev-webpack/commit/ba6d896))
* show message for stopping webpack only when it has been started ([#821](https://github.com/NativeScript/nativescript-dev-webpack/issues/821)) ([1bd18e5](https://github.com/NativeScript/nativescript-dev-webpack/commit/1bd18e5))
* **HMR:** modulePath on Windows to apply changes in app styles at runtime ([#807](https://github.com/NativeScript/nativescript-dev-webpack/issues/807)) ([cc55d4f](https://github.com/NativeScript/nativescript-dev-webpack/commit/cc55d4f))


### Features

* **Vue:** option to enable sourcemaps ([#774](https://github.com/NativeScript/nativescript-dev-webpack/issues/774)) ([70cd58a](https://github.com/NativeScript/nativescript-dev-webpack/commit/70cd58a))



<a name="0.20.1"></a>
## [0.20.1](https://github.com/NativeScript/nativescript-dev-webpack/compare/0.20.0...0.20.1) (2019-02-18)

Expand Down
3 changes: 1 addition & 2 deletions lib/after-watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ const { stopWebpackCompiler } = require('./compiler');
const { removeListener } = require("./utils");

module.exports = function($logger, $liveSyncService) {
$logger.info("Stopping webpack watch");
stopWebpackCompiler();
stopWebpackCompiler($logger);
removeListener($liveSyncService, "liveSyncStopped");
removeListener(process, "exit");
}
4 changes: 2 additions & 2 deletions lib/before-watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ module.exports = function ($logger, $liveSyncService, $devicesService, hookArgs)
Object.keys(webpackProcesses).forEach(platform => {
const devices = $devicesService.getDevicesForPlatform(platform);
if (!devices || !devices.length) {
stopWebpackCompiler(platform);
stopWebpackCompiler($logger, platform);
}
});
});
addListener(process, "exit", stopWebpackCompiler);
addListener(process, "exit", () => stopWebpackCompiler($logger));

const platforms = hookArgs.config.platforms;
return Promise.all(platforms.map(platform => {
Expand Down
9 changes: 5 additions & 4 deletions lib/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,11 @@ exports.runWebpackCompiler = function runWebpackCompiler(config, $projectData, $
}
}

exports.stopWebpackCompiler = function stopWebpackCompiler(platform) {
exports.stopWebpackCompiler = function stopWebpackCompiler($logger, platform) {
if (platform) {
stopWebpackForPlatform(platform);
stopWebpackForPlatform($logger, platform);
} else {
Object.keys(webpackProcesses).forEach(platform => stopWebpackForPlatform(platform));
Object.keys(webpackProcesses).forEach(platform => stopWebpackForPlatform($logger, platform));
}
}

Expand Down Expand Up @@ -171,7 +171,8 @@ function logSnapshotWarningMessage($logger) {
}
}

function stopWebpackForPlatform(platform) {
function stopWebpackForPlatform($logger, platform) {
$logger.trace(`Stopping webpack watch for platform ${platform}.`);
const webpackProcess = webpackProcesses[platform];
if (webpackProcess) {
webpackProcess.kill("SIGINT");
Expand Down
2 changes: 2 additions & 0 deletions templates/webpack.angular.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
const { NativeScriptWorkerPlugin } = require("nativescript-worker-loader/NativeScriptWorkerPlugin");
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
const { AngularCompilerPlugin } = require("@ngtools/webpack");
const hashSalt = Date.now().toString();

module.exports = env => {
// Add your custom Activities, Services and other Android app components here.
Expand Down Expand Up @@ -112,6 +113,7 @@ module.exports = env => {
libraryTarget: "commonjs2",
filename: "[name].js",
globalObject: "global",
hashSalt
},
resolve: {
extensions: [".ts", ".js", ".scss", ".css"],
Expand Down
2 changes: 2 additions & 0 deletions templates/webpack.javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const CopyWebpackPlugin = require("copy-webpack-plugin");
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
const { NativeScriptWorkerPlugin } = require("nativescript-worker-loader/NativeScriptWorkerPlugin");
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
const hashSalt = Date.now().toString();

module.exports = env => {
// Add your custom Activities, Services and other android app components here.
Expand Down Expand Up @@ -73,6 +74,7 @@ module.exports = env => {
libraryTarget: "commonjs2",
filename: "[name].js",
globalObject: "global",
hashSalt
},
resolve: {
extensions: [".js", ".scss", ".css"],
Expand Down
2 changes: 2 additions & 0 deletions templates/webpack.typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const CopyWebpackPlugin = require("copy-webpack-plugin");
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
const { NativeScriptWorkerPlugin } = require("nativescript-worker-loader/NativeScriptWorkerPlugin");
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
const hashSalt = Date.now().toString();

module.exports = env => {
// Add your custom Activities, Services and other Android app components here.
Expand Down Expand Up @@ -73,6 +74,7 @@ module.exports = env => {
libraryTarget: "commonjs2",
filename: "[name].js",
globalObject: "global",
hashSalt
},
resolve: {
extensions: [".ts", ".js", ".scss", ".css"],
Expand Down
5 changes: 4 additions & 1 deletion templates/webpack.vue.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const NsVueTemplateCompiler = require("nativescript-vue-template-compiler");
const nsWebpack = require("nativescript-dev-webpack");
const nativescriptTarget = require("nativescript-dev-webpack/nativescript-target");
const { NativeScriptWorkerPlugin } = require("nativescript-worker-loader/NativeScriptWorkerPlugin");
const hashSalt = Date.now().toString();

module.exports = env => {
// Add your custom Activities, Services and other android app components here.
Expand Down Expand Up @@ -44,6 +45,7 @@ module.exports = env => {
production, // --env.production
report, // --env.report
hmr, // --env.hmr
sourceMap, // --env.sourceMap
} = env;

const externals = nsWebpack.getConvertedExternals(env.externals);
Expand Down Expand Up @@ -81,6 +83,7 @@ module.exports = env => {
libraryTarget: "commonjs2",
filename: "[name].js",
globalObject: "global",
hashSalt
},
resolve: {
extensions: [".vue", ".ts", ".js", ".scss", ".css"],
Expand Down Expand Up @@ -111,7 +114,7 @@ module.exports = env => {
"fs": "empty",
"__dirname": false,
},
devtool: "none",
devtool: sourceMap ? "inline-source-map" : "none",
optimization: {
runtimeChunk: "single",
splitChunks: {
Expand Down