From e9e038d3639bcbb5d1d17067ee576896bed94c75 Mon Sep 17 00:00:00 2001 From: Janne Kurkinen Date: Wed, 23 Sep 2020 11:36:44 +0300 Subject: [PATCH 01/88] docs: 'prependData' option renamed to 'additionalData' in sass-loader 9 (#1714) [skip ci] --- docs/guide/pre-processors.md | 7 ++++--- docs/ru/guide/pre-processors.md | 3 ++- docs/zh/guide/pre-processors.md | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/guide/pre-processors.md b/docs/guide/pre-processors.md index 27378e181..d4cb42d13 100644 --- a/docs/guide/pre-processors.md +++ b/docs/guide/pre-processors.md @@ -75,7 +75,7 @@ Note that `sass-loader` processes the non-indent-based `scss` syntax by default. ### Sharing Global Variables -`sass-loader` also supports a `prependData` option which allows you to share common variables among all processed files without having to explicit import them: +`sass-loader` also supports a `additionalData` option which allows you to share common variables among all processed files without having to explicit import them: ``` js // webpack.config.js -> module.rules @@ -88,8 +88,9 @@ Note that `sass-loader` processes the non-indent-based `scss` syntax by default. loader: 'sass-loader', options: { // you can also read from a file, e.g. `variables.scss` - // use `data` here if sass-loader version < 8 - prependData: `$color: red;` + // use `prependData` here if sass-loader version = 8, or + // `data` if sass-loader version < 8 + additionalData: `$color: red;` } } ] diff --git a/docs/ru/guide/pre-processors.md b/docs/ru/guide/pre-processors.md index f593d7c72..41e846598 100644 --- a/docs/ru/guide/pre-processors.md +++ b/docs/ru/guide/pre-processors.md @@ -88,8 +88,9 @@ module.exports = { loader: 'sass-loader', options: { // вы можете также указать файл, например `variables.scss` + // используйте свойство `prependData` здесь, если версия sass-loader = 8 // используйте свойство `data` здесь, если версия sass-loader < 8 - prependData: `$color: red;` + additionalData: `$color: red;` } } ] diff --git a/docs/zh/guide/pre-processors.md b/docs/zh/guide/pre-processors.md index 654c41d87..d8f6107da 100644 --- a/docs/zh/guide/pre-processors.md +++ b/docs/zh/guide/pre-processors.md @@ -88,8 +88,9 @@ module.exports = { loader: 'sass-loader', options: { // 你也可以从一个文件读取,例如 `variables.scss` + // 如果 sass-loader 版本 = 8,这里使用 `prependData` 字段 // 如果 sass-loader 版本 < 8,这里使用 `data` 字段 - prependData: `$color: red;` + additionalData: `$color: red;` } } ] From b1665abb4788fd94c865aa9df7f3016a140cde42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karsten=20K=C3=B6hler?= Date: Mon, 26 Oct 2020 07:22:38 +0100 Subject: [PATCH 02/88] docs: fix typo in pre-processors.md (#1743) --- docs/guide/pre-processors.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/pre-processors.md b/docs/guide/pre-processors.md index d4cb42d13..432364458 100644 --- a/docs/guide/pre-processors.md +++ b/docs/guide/pre-processors.md @@ -222,7 +222,7 @@ module.exports = { } ``` -Configuration of TypeScipt can be done via `tsconfig.json`. Also see docs for [ts-loader](https://github.com/TypeStrong/ts-loader). +Configuration of TypeScript can be done via `tsconfig.json`. Also see docs for [ts-loader](https://github.com/TypeStrong/ts-loader). ## Pug From a158e84f4ba83486194fb9a26513520137163696 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A1=B9=E9=B8=BF=E4=BC=9F?= <734824565@qq.com> Date: Mon, 26 Oct 2020 14:30:39 +0800 Subject: [PATCH 03/88] docs(cn): Update scoped-css.md (#1746) [ci skip] --- docs/zh/guide/scoped-css.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/zh/guide/scoped-css.md b/docs/zh/guide/scoped-css.md index 0c369d4c5..39627ec55 100644 --- a/docs/zh/guide/scoped-css.md +++ b/docs/zh/guide/scoped-css.md @@ -70,6 +70,6 @@ ## 还有一些要留意 -- **Scoped 样式不能代替 class**。考虑到浏览器渲染各种 CSS 选择器的方式,当 `p { color: red }` 是 scoped 时 (即与特性选择器组合使用时) 会慢很多倍。如果你使用 class 或者 id 取而代之,比如 `.example { color: red }`,性能影响就会消除。你可以在[这块试验田](https://stevesouders.com/efws/css-selectors/csscreate.php)中测试它们的不同。 +- **Scoped 样式不能代替 class**。考虑到浏览器渲染各种 CSS 选择器的方式,当 `p { color: red }` 是 scoped 时 (即与特性选择器组合使用时) 会慢很多倍。如果你使用 class 或者 id 取而代之,比如 `.example { color: red }`,性能影响就会消除。 - **在递归组件中小心使用后代选择器!** 对选择器 `.a .b` 中的 CSS 规则来说,如果匹配 `.a` 的元素包含一个递归子组件,则所有的子组件中的 `.b` 都将被这个规则匹配。 From 46709417883d35f54ad66e39babe61af6eeccd64 Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Mon, 26 Oct 2020 14:44:41 +0800 Subject: [PATCH 04/88] test: add explicit publicPath to fix webpack 5 errors --- test/utils.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/utils.js b/test/utils.js index ea4fd0f48..53525c75e 100644 --- a/test/utils.js +++ b/test/utils.js @@ -14,6 +14,7 @@ const baseConfig = { devtool: false, output: { path: '/', + publicPath: '', filename: 'test.build.js' }, resolveLoader: { From afe8a0d74e677272c740929ea85771dfe76e32a1 Mon Sep 17 00:00:00 2001 From: liudh <9798291@qq.com> Date: Mon, 26 Oct 2020 15:37:12 +0800 Subject: [PATCH 05/88] fix: fix id differences between different operating systems (#1706) Co-authored-by: liudenghui_bxbank --- lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index 3ca9d1e9e..990c86235 100644 --- a/lib/index.js +++ b/lib/index.js @@ -93,7 +93,7 @@ module.exports = function (source) { const id = hash( isProduction - ? (shortFilePath + '\n' + source) + ? (shortFilePath + '\n' + source.replace(/\r\n/g, '\n')) : shortFilePath ) From 429a28478c3abaaa682f6751714156db598dffee Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Tue, 27 Oct 2020 03:41:55 -0400 Subject: [PATCH 06/88] fix: fix mini-css-extract-plugin missing default export error (#1748) Default exports should only be used for CSS modules. --- lib/loaders/pitcher.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/loaders/pitcher.js b/lib/loaders/pitcher.js index 222b9130c..2d7947f86 100644 --- a/lib/loaders/pitcher.js +++ b/lib/loaders/pitcher.js @@ -120,7 +120,9 @@ module.exports.pitch = function (remainingRequest) { ...beforeLoaders ]) // console.log(request) - return `import mod from ${request}; export default mod; export * from ${request}` + return query.module + ? `export { default } from ${request}; export * from ${request}` + : `export * from ${request}` } } From 9c26597957fbe7c9ee93b4b6f14b148a85b51790 Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Tue, 27 Oct 2020 15:46:12 +0800 Subject: [PATCH 07/88] 15.9.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 61f7e80fb..b1c3e9622 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-loader", - "version": "15.9.3", + "version": "15.9.4", "description": "Vue single-file component loader for Webpack", "main": "lib/index.js", "typings": "lib/index.d.ts", From dff77b53a8434eb1a95996ac8746aa3a178fd970 Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Tue, 27 Oct 2020 15:47:25 +0800 Subject: [PATCH 08/88] chore: v15.9.4 changelog [ci skip] --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16df21eb8..d38563a61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ + +## [15.9.4](https://github.com/vuejs/vue-loader/compare/v15.9.3...v15.9.4) (2020-10-27) + + +### Bug Fixes + +* fix id differences between different operating systems ([#1706](https://github.com/vuejs/vue-loader/issues/1706)) ([afe8a0d](https://github.com/vuejs/vue-loader/commit/afe8a0d)) +* fix mini-css-extract-plugin missing default export error ([#1748](https://github.com/vuejs/vue-loader/issues/1748)) ([429a284](https://github.com/vuejs/vue-loader/commit/429a284)) + + + ## [15.9.3](https://github.com/vuejs/vue-loader/compare/v15.9.2...v15.9.3) (2020-06-23) From f79bb087f9211c3ea19d63c1dcfd758d6dbad095 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorsten=20L=C3=BCnborg?= Date: Thu, 29 Oct 2020 09:11:28 +0100 Subject: [PATCH 09/88] fix: ensure new webpack5 generator property in rules passes ruleset checks (#1753) close #1729 Co-authored-by: Thorsten Luenborg --- lib/plugin-webpack5.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/plugin-webpack5.js b/lib/plugin-webpack5.js index 431fdf06f..ea0271cc2 100644 --- a/lib/plugin-webpack5.js +++ b/lib/plugin-webpack5.js @@ -20,6 +20,7 @@ const ruleSetCompiler = new RuleSetCompiler([ new BasicEffectRulePlugin('sideEffects'), new BasicEffectRulePlugin('parser'), new BasicEffectRulePlugin('resolve'), + new BasicEffectRulePlugin('generator'), new UseEffectRulePlugin() ]) From 7ca8e2c58926144042095a67eea9326e4c206b13 Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Thu, 29 Oct 2020 21:54:14 +0800 Subject: [PATCH 10/88] fix: add rule plugins to keep up with webpack 5 new features Reference: https://github.com/webpack/webpack/blob/v5.3.1/lib/NormalModuleFactory.js#L133-L152 --- lib/plugin-webpack5.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/plugin-webpack5.js b/lib/plugin-webpack5.js index ea0271cc2..dcec6e0c6 100644 --- a/lib/plugin-webpack5.js +++ b/lib/plugin-webpack5.js @@ -3,19 +3,24 @@ const id = 'vue-loader-plugin' const NS = 'vue-loader' const BasicEffectRulePlugin = require('webpack/lib/rules/BasicEffectRulePlugin') const BasicMatcherRulePlugin = require('webpack/lib/rules/BasicMatcherRulePlugin') +const DescriptionDataMatcherRulePlugin = require('webpack/lib/rules/DescriptionDataMatcherRulePlugin') const RuleSetCompiler = require('webpack/lib/rules/RuleSetCompiler') const UseEffectRulePlugin = require('webpack/lib/rules/UseEffectRulePlugin') const ruleSetCompiler = new RuleSetCompiler([ new BasicMatcherRulePlugin('test', 'resource'), + new BasicMatcherRulePlugin('mimetype'), + new BasicMatcherRulePlugin('dependency'), new BasicMatcherRulePlugin('include', 'resource'), new BasicMatcherRulePlugin('exclude', 'resource', true), - new BasicMatcherRulePlugin('resource'), new BasicMatcherRulePlugin('conditions'), + new BasicMatcherRulePlugin('resource'), new BasicMatcherRulePlugin('resourceQuery'), + new BasicMatcherRulePlugin('resourceFragment'), new BasicMatcherRulePlugin('realResource'), new BasicMatcherRulePlugin('issuer'), new BasicMatcherRulePlugin('compiler'), + new DescriptionDataMatcherRulePlugin(), new BasicEffectRulePlugin('type'), new BasicEffectRulePlugin('sideEffects'), new BasicEffectRulePlugin('parser'), From 1fe1b8d234ef15016ab8d92da83ab438bb2c84cb Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Mon, 2 Nov 2020 16:16:44 +0800 Subject: [PATCH 11/88] 15.9.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b1c3e9622..66e570ea5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-loader", - "version": "15.9.4", + "version": "15.9.5", "description": "Vue single-file component loader for Webpack", "main": "lib/index.js", "typings": "lib/index.d.ts", From b9bea03ecd00d3bf895903a9fc155c9ca94790a4 Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Mon, 2 Nov 2020 16:18:00 +0800 Subject: [PATCH 12/88] docs: v15.9.5 changelog --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d38563a61..f1e1882bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ + +## [15.9.5](https://github.com/vuejs/vue-loader/compare/v15.9.4...v15.9.5) (2020-11-02) + + +### Bug Fixes + +* add rule plugins to keep up with webpack 5 new features ([7ca8e2c](https://github.com/vuejs/vue-loader/commit/7ca8e2c)), closes [/github.com/webpack/webpack/blob/v5.3.1/lib/NormalModuleFactory.js#L133-L152](https://github.com//github.com/webpack/webpack/blob/v5.3.1/lib/NormalModuleFactory.js/issues/L133-L152) +* ensure new webpack5 generator property in rules passes ruleset checks ([#1753](https://github.com/vuejs/vue-loader/issues/1753)) ([f79bb08](https://github.com/vuejs/vue-loader/commit/f79bb08)), closes [#1729](https://github.com/vuejs/vue-loader/issues/1729) + + + ## [15.9.4](https://github.com/vuejs/vue-loader/compare/v15.9.3...v15.9.4) (2020-10-27) From 55a66f31c2a568415c67f34e4432fc1661b2f3ee Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Mon, 2 Nov 2020 16:19:24 +0800 Subject: [PATCH 13/88] docs: fix links in changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f1e1882bc..81962cec3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ ### Bug Fixes -* add rule plugins to keep up with webpack 5 new features ([7ca8e2c](https://github.com/vuejs/vue-loader/commit/7ca8e2c)), closes [/github.com/webpack/webpack/blob/v5.3.1/lib/NormalModuleFactory.js#L133-L152](https://github.com//github.com/webpack/webpack/blob/v5.3.1/lib/NormalModuleFactory.js/issues/L133-L152) +* add rule plugins to keep up with webpack 5 new features ([7ca8e2c](https://github.com/vuejs/vue-loader/commit/7ca8e2c)) * ensure new webpack5 generator property in rules passes ruleset checks ([#1753](https://github.com/vuejs/vue-loader/issues/1753)) ([f79bb08](https://github.com/vuejs/vue-loader/commit/f79bb08)), closes [#1729](https://github.com/vuejs/vue-loader/issues/1729) From 74020775b3e5a814c87d99381564e0d9e3d8d912 Mon Sep 17 00:00:00 2001 From: Binwei Fang Date: Wed, 11 Nov 2020 15:41:03 +0800 Subject: [PATCH 14/88] docs: fix mistakes in README (#1744) [skip ci] --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a840bdf68..ed575fb70 100644 --- a/README.md +++ b/README.md @@ -107,14 +107,14 @@ In a nutshell, the combination of webpack and `vue-loader` gives you a modern, f 4. For the `