From 5f8f40bab5dc4bfcc2735ba648543b792ffe389b Mon Sep 17 00:00:00 2001 From: Vasil Chimev Date: Mon, 14 Jan 2019 11:32:35 +0200 Subject: [PATCH 1/3] fix(Vue): apply style changes with HMR (#763) * fix(Vue): apply style changes with HMR The `bundle-config-loader` executes for `entryPath` with all extensions: `css`, `js`, `ts`, `scss`, etc. Limit only to `js` and `ts`. Fixes https://github.com/NativeScript/nativescript-dev-webpack/issues/762. * Revert "fix(Vue): resolve full path for entry module (#744)" This reverts commit 4d31ea050cb7eeff134473852b73f33ec86df7d1. It causes https://github.com/NativeScript/nativescript-dev-webpack/issues/762. * fix(Vue): entry module path Fixes #742, fixes #762. --- templates/webpack.vue.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/webpack.vue.js b/templates/webpack.vue.js index ad354e56..043d0a9f 100644 --- a/templates/webpack.vue.js +++ b/templates/webpack.vue.js @@ -1,4 +1,4 @@ -const { relative, resolve } = require("path"); +const { relative, resolve, sep } = require("path"); const webpack = require("webpack"); const CleanWebpackPlugin = require("clean-webpack-plugin"); @@ -56,7 +56,7 @@ module.exports = env => { const appResourcesFullPath = resolve(projectRoot, appResourcesPath); const entryModule = nsWebpack.getEntryModule(appFullPath); - const entryPath = resolve(appFullPath, entryModule); + const entryPath = `.${sep}${entryModule}`; console.log(`Bundling application for entryPath ${entryPath}...`); const config = { @@ -150,7 +150,7 @@ module.exports = env => { }, module: { rules: [{ - test: entryPath, + test: new RegExp(entryPath + ".(js|ts)"), use: [ // Require all Android app components platform === "android" && { From a333a7c7389969dbd50c86d4227fa57b025e773b Mon Sep 17 00:00:00 2001 From: Svetoslav Date: Thu, 3 Jan 2019 17:45:20 +0200 Subject: [PATCH 2/3] Release 0.19.0 (#757) --- CHANGELOG.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b4e33e2..d4beec81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,19 +1,17 @@ -# [0.19.0](https://github.com/NativeScript/nativescript-dev-webpack/compare/0.18.3...0.19.0) (2019-01-03) +# [0.19.0](https://github.com/NativeScript/nativescript-dev-webpack/compare/0.18.5...0.19.0) (2019-01-03) ### Bug Fixes * **angular:** support angular lazy routes in preview ([#753](https://github.com/NativeScript/nativescript-dev-webpack/issues/753)) ([a6c23da](https://github.com/NativeScript/nativescript-dev-webpack/commit/a6c23da)) * **Angular:** add hot loader for lazy loaded NgModules ([#747](https://github.com/NativeScript/nativescript-dev-webpack/issues/747)) ([6a9db32](https://github.com/NativeScript/nativescript-dev-webpack/commit/6a9db32)) -* **JS/TS:** use webpack resolver instead of Node.js resolver ([#681](https://github.com/NativeScript/nativescript-dev-webpack/issues/681)) ([9adc7e7](https://github.com/NativeScript/nativescript-dev-webpack/commit/9adc7e7)) * **Vue:** disable mangling of function names when building in production mode ([#743](https://github.com/NativeScript/nativescript-dev-webpack/issues/743)) ([fffcf66](https://github.com/NativeScript/nativescript-dev-webpack/commit/fffcf66)), closes [/github.com/NativeScript/nativescript-dev-webpack/blob/master/CONTRIBUTING.md#testing-locally-by-running-e2](https://github.com//github.com/NativeScript/nativescript-dev-webpack/blob/master/CONTRIBUTING.md/issues/testing-locally-by-running-e2) ### Features * **TypeScript:** use `ts-loader` instead of `awesome-typescript-loader` ([#738](https://github.com/NativeScript/nativescript-dev-webpack/issues/738)) ([7f67198](https://github.com/NativeScript/nativescript-dev-webpack/commit/7f67198)) -* **Vue:** add support for TypeScript ([#734](https://github.com/NativeScript/nativescript-dev-webpack/issues/734)) ([d290515](https://github.com/NativeScript/nativescript-dev-webpack/commit/d290515)) ### BREAKING CHANGES From 80b69b6a99187922560bdcd737646d80f8a600f5 Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Thu, 24 Jan 2019 13:25:15 +0200 Subject: [PATCH 3/3] fix: lazy-ngmodule-hot-loader breaks the sourceMaps The `lazy-ngmodule-hot-loader` breaks sourceMaps as it does not pass them to the next loaders. This breaks debugging with `--bundle` in VSCode extension as the files included in the `sourcesContent` cannot be mapped correctly to local files. --- lazy-ngmodule-hot-loader.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lazy-ngmodule-hot-loader.js b/lazy-ngmodule-hot-loader.js index 1f168c6a..828afc98 100644 --- a/lazy-ngmodule-hot-loader.js +++ b/lazy-ngmodule-hot-loader.js @@ -10,8 +10,10 @@ const isLazyLoadedNgModule = resource => { return issuerContext && issuerContext.endsWith(LAZY_RESOURCE_CONTEXT); }; -module.exports = function (source) { - return isLazyLoadedNgModule(this._module) ? +module.exports = function (source, map) { + const modifiedSource = isLazyLoadedNgModule(this._module) ? `${source};${HOT_SELF_ACCEPT}`: source; + + this.callback(null, modifiedSource, map); };