From d67c85c671a87ef4a569bcea12a3e00934d9909c Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Sat, 7 Oct 2023 16:32:49 +0800 Subject: [PATCH 01/19] chore: v17.3.0 changelog --- CHANGELOG.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 84ce6ea2d..10d136661 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +# [17.3.0](https://github.com/vuejs/vue-loader/compare/v17.2.2...v17.3.0) (2023-10-07) + + +### Bug Fixes + +* re-use ident of vue rule for template compiler, fixes [#2029](https://github.com/vuejs/vue-loader/issues/2029) ([#2030](https://github.com/vuejs/vue-loader/issues/2030)) ([b50fa56](https://github.com/vuejs/vue-loader/commit/b50fa5665f2cbc1c0b8e18f65dd3adf1dfe848dc)) + + +### Features + +* skip normal css files without scoped flag in stylePostLoader ([#2053](https://github.com/vuejs/vue-loader/issues/2053)) ([98782e7](https://github.com/vuejs/vue-loader/commit/98782e794fadca83b600b047b55aa6f0c230cc25)) + + + ## [17.2.2](https://github.com/vuejs/vue-loader/compare/v17.2.1...v17.2.2) (2023-06-02) From d7071bbdeb45518c053bdae8eb7de52fc598adc6 Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Tue, 31 Oct 2023 14:01:04 +0800 Subject: [PATCH 02/19] fix: do not skip style post loader for v-bind() in CSS These styles may or may not be scoped. Fixes #2061 --- src/stylePostLoader.ts | 9 ++------- test/fixtures/style-v-bind.vue | 25 +++++++++++++++++++++++++ test/style.spec.ts | 20 +++++++++++++++++++- 3 files changed, 46 insertions(+), 8 deletions(-) create mode 100644 test/fixtures/style-v-bind.vue diff --git a/src/stylePostLoader.ts b/src/stylePostLoader.ts index 59c664d5b..20a8645ac 100644 --- a/src/stylePostLoader.ts +++ b/src/stylePostLoader.ts @@ -10,13 +10,8 @@ const { compileStyle } = compiler const StylePostLoader: LoaderDefinitionFunction = function (source, inMap) { const query = qs.parse(this.resourceQuery.slice(1)) - // skip normal CSS files without scoped flag - if ( - !('vue' in query) || - query.type !== 'style' || - !query.id || - !query.scoped - ) { + // skip normal CSS files + if (!('vue' in query) || query.type !== 'style' || !query.id) { this.callback(null, source, inMap) return } diff --git a/test/fixtures/style-v-bind.vue b/test/fixtures/style-v-bind.vue new file mode 100644 index 000000000..143bdb326 --- /dev/null +++ b/test/fixtures/style-v-bind.vue @@ -0,0 +1,25 @@ + + + + + diff --git a/test/style.spec.ts b/test/style.spec.ts index 4bb998dbe..72fb3cbd3 100644 --- a/test/style.spec.ts +++ b/test/style.spec.ts @@ -198,4 +198,22 @@ test('CSS Modules Extend', async () => { expect(style).toContain(`.${instance.$style.red} {\n color: #FF0000;\n}`) }) -test.todo('experimental