From 5f8f40bab5dc4bfcc2735ba648543b792ffe389b Mon Sep 17 00:00:00 2001 From: Vasil Chimev Date: Mon, 14 Jan 2019 11:32:35 +0200 Subject: [PATCH] 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" && {