From 91d29b1fd9bfbfb3165a696e6f0748c341a5a896 Mon Sep 17 00:00:00 2001 From: ULIVZ <472590061@qq.com> Date: Fri, 1 Jun 2018 21:34:26 +0800 Subject: [PATCH 1/6] chore: avoid using templates literals for string constants (#1333) --- lib/codegen/hotReload.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/codegen/hotReload.js b/lib/codegen/hotReload.js index 71fadd007..4f426b4d0 100644 --- a/lib/codegen/hotReload.js +++ b/lib/codegen/hotReload.js @@ -22,9 +22,9 @@ if (module.hot) { if (!module.hot.data) { api.createRecord('${id}', component.options) } else { - api.${functional ? `rerender` : `reload`}('${id}', component.options) + api.${functional ? 'rerender' : 'reload'}('${id}', component.options) } - ${templateRequest ? genTemplateHotReloadCode(id, templateRequest) : ``} + ${templateRequest ? genTemplateHotReloadCode(id, templateRequest) : ''} } } `.trim() From 550fe3739f6290bfb7a4d3011b6550f859c0022e Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 1 Jun 2018 09:42:14 -0400 Subject: [PATCH 2/6] chore: lint in test script --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 959169344..45768d1c6 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "lib/index.js", "typings": "lib/index.d.ts", "scripts": { - "test": "jest --env node", + "test": "yarn lint && jest --env node", "lint": "eslint lib test --fix", "build": "webpack --config example/webpack.config.js --hide-modules", "dev": "webpack-dev-server --config example/webpack.config.js --inline --hot", From 883df7dc0b9a2205e04cb052c45f9cdfcde52f5f Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 1 Jun 2018 09:42:19 -0400 Subject: [PATCH 3/6] 15.2.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 45768d1c6..a7baf390f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-loader", - "version": "15.2.2", + "version": "15.2.3", "description": "Vue single-file component loader for Webpack", "main": "lib/index.js", "typings": "lib/index.d.ts", From 2c8d24528304e1dd1f947f67d368b91ebbcfe71b Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 1 Jun 2018 09:42:53 -0400 Subject: [PATCH 4/6] chore: changelog --- CHANGELOG.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb678df65..248a63fae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,19 @@ + +## [15.2.3](https://github.com/vuejs/vue-loader/compare/v15.2.2...v15.2.3) (2018-06-01) + + +### Bug Fixes + +* ensure plugin error is emitted only once ([0b006a3](https://github.com/vuejs/vue-loader/commit/0b006a3)) +* use constant plugin NS ([0fb5172](https://github.com/vuejs/vue-loader/commit/0fb5172)), closes [#1331](https://github.com/vuejs/vue-loader/issues/1331) + + +### Features + +* inject issuerPath to resourceQuery for custom block src imports ([#1313](https://github.com/vuejs/vue-loader/issues/1313)) ([a004e30](https://github.com/vuejs/vue-loader/commit/a004e30)) + + + ## [15.2.2](https://github.com/vuejs/vue-loader/compare/v15.2.0...v15.2.2) (2018-05-28) From c4a2719ffd65328dffe7170eae6d80ee5ce88994 Mon Sep 17 00:00:00 2001 From: ULIVZ <472590061@qq.com> Date: Sat, 2 Jun 2018 02:01:52 +0800 Subject: [PATCH 5/6] fix: fix unexpected error when options of cache-loader contains ! (#1334) --- docs/options.md | 4 ++++ docs/zh/options.md | 4 ++++ lib/loaders/pitcher.js | 3 ++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/options.md b/docs/options.md index c10180561..2be9e0314 100644 --- a/docs/options.md +++ b/docs/options.md @@ -81,3 +81,7 @@ Compiled the component for usage inside Shadow DOM. In this mode, the styles of - default: `undefined` When both options are specified, enables file-system-based template compilation caching (requires `cache-loader` to be installed in the same project). + +::: tip + Interaction between `vue-loader` and `cache-loader` uses [inline loader import syntax](https://webpack.js.org/concepts/loaders/#inline) under the hook, the `!` will be treated as the separator between different loaders, so please ensure `cacheDirectory` doesn't contain `!`. +::: diff --git a/docs/zh/options.md b/docs/zh/options.md index b8bfbfcbb..1cf0dc684 100644 --- a/docs/zh/options.md +++ b/docs/zh/options.md @@ -81,3 +81,7 @@ sidebar: auto - 默认值:`undefined` 当这两个选项同时被设置时,开启基于文件系统的模板编译缓存 (需要在工程里安装 `cache-loader`)。 + +::: tip 注意 + 在内部,`vue-loader` 和 `cache-loader` 之间的交互使用了 [loader 的内联 import 语法](https://webpack.js.org/concepts/loaders/#inline),`!` 将会被认为是不同 loaders 之间的分隔符,所以请确保你的 `cacheDirectory` 路径中不包含 `!`。 +::: diff --git a/lib/loaders/pitcher.js b/lib/loaders/pitcher.js index 9ed4ceece..184e8fd09 100644 --- a/lib/loaders/pitcher.js +++ b/lib/loaders/pitcher.js @@ -1,5 +1,6 @@ const qs = require('querystring') const loaderUtils = require('loader-utils') +const hash = require('hash-sum') const selfPath = require.resolve('../index') const templateLoaderPath = require.resolve('./templateLoader') const stylePostLoaderPath = require.resolve('./stylePostLoader') @@ -74,7 +75,7 @@ module.exports.pitch = function (remainingRequest) { const cacheLoader = cacheDirectory && cacheIdentifier ? [`cache-loader?${JSON.stringify({ cacheDirectory, - cacheIdentifier: cacheIdentifier + '-vue-loader-template' + cacheIdentifier: hash(cacheIdentifier) + '-vue-loader-template' })}`] : [] const request = genRequest([ From 935c83ed2e2554706f628f6dbacb00d52d4374f8 Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 1 Jun 2018 14:04:25 -0400 Subject: [PATCH 6/6] 15.2.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a7baf390f..d11848afd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-loader", - "version": "15.2.3", + "version": "15.2.4", "description": "Vue single-file component loader for Webpack", "main": "lib/index.js", "typings": "lib/index.d.ts",