diff --git a/CHANGELOG.md b/CHANGELOG.md index ff0cbe416..4f4f4e633 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,21 @@ +## [17.1.1](https://github.com/vuejs/vue-loader/compare/v17.1.0...v17.1.1) (2023-05-11) + + +### Bug Fixes + +* support propsDestructure and defineModel options ([6269698](https://github.com/vuejs/vue-loader/commit/6269698f9fda37f0e3849db3e8b8e67ad1862f57)) + + + +# [17.1.0](https://github.com/vuejs/vue-loader/compare/v17.1.0-beta.0...v17.1.0) (2023-04-26) + + +### Bug Fixes + +* do not throw when `Rule.layer` ([#2000](https://github.com/vuejs/vue-loader/issues/2000)) ([ef589df](https://github.com/vuejs/vue-loader/commit/ef589df2956506a5a7bbc050c476501d32dd8469)) + + + # [17.1.0](https://github.com/vuejs/vue-loader/compare/v17.1.0-beta.0...v17.1.0) (2023-04-26) diff --git a/package.json b/package.json index 2f5134289..bf2d9a177 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-loader", - "version": "17.1.1", + "version": "17.1.2", "license": "MIT", "author": "Evan You", "repository": "vuejs/vue-loader", diff --git a/src/index.ts b/src/index.ts index dabc5c000..aa4dfc9df 100644 --- a/src/index.ts +++ b/src/index.ts @@ -58,7 +58,7 @@ export interface VueLoaderOptions { let errorEmitted = false const { parse } = compiler -const exportHelperPath = JSON.stringify(require.resolve('./exportHelper')) +const exportHelperPath = require.resolve('./exportHelper') export default function loader( this: LoaderContext, @@ -296,7 +296,7 @@ export default function loader( if (!propsToAttach.length) { code += `\n\nconst __exports__ = script;` } else { - code += `\n\nimport exportComponent from ${exportHelperPath}` + code += `\n\nimport exportComponent from ${stringifyRequest(exportHelperPath)}` code += `\nconst __exports__ = /*#__PURE__*/exportComponent(script, [${propsToAttach .map(([key, val]) => `['${key}',${val}]`) .join(',')}])` diff --git a/src/pluginWebpack4.ts b/src/pluginWebpack4.ts index fb0669870..335a6a0a9 100644 --- a/src/pluginWebpack4.ts +++ b/src/pluginWebpack4.ts @@ -171,6 +171,15 @@ class VueLoaderPlugin { watcher.close() } }) + + // In some cases, e.g. in this project's tests, + // even though needsHMR() returns true, webpack is not watching, thus no watchClose hook is called. + // So we need to close the watcher when webpack is done. + compiler.hooks.done.tap(id, () => { + if (watcher) { + watcher.close() + } + }) } } }