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

Vladimirov/fix lazy loading loader release #778

Merged
merged 3 commits into from
Jan 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
<a name="0.19.0"></a>
# [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
Expand Down
6 changes: 4 additions & 2 deletions lazy-ngmodule-hot-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
6 changes: 3 additions & 3 deletions templates/webpack.vue.js
Original file line number Diff line number Diff line change
@@ -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");
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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" && {
Expand Down