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 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); }; 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" && {