Skip to content

Commit ff7612d

Browse files
committed
Squashed commit of the following:
commit 04f9b72 Merge: ab1eb06 4240e5b Author: Eric Chen <[email protected]> Date: Wed Sep 1 10:16:02 2021 +0800 Merge branch 'vuejs:master' into fix/css-loader-compat commit ab1eb06 Author: Eric Chen <[email protected]> Date: Thu Jul 22 16:56:21 2021 +0800 fix(css-modules): support `namedExport: false` commit 91c162b Author: Eric Chen <[email protected]> Date: Thu Jul 22 15:35:48 2021 +0800 refactor(codegen): style injection commit 229052c Merge: 8b5f82a b179fb9 Author: Eric Chen <[email protected]> Date: Wed Jun 2 10:38:14 2021 +0800 Merge branch 'vuejs:master' into fix/css-loader-compat commit 8b5f82a Author: Eric Chen <[email protected]> Date: Sun May 9 17:26:30 2021 +0800 test: fix html error commit bb48844 Author: Eric Chen <[email protected]> Date: Sun May 9 17:21:57 2021 +0800 test: set timeout to 30000 commit d265384 Author: Eric Chen <[email protected]> Date: Fri Apr 23 18:54:26 2021 +0800 fix: testing commit b0caa9f Author: Eric Chen <[email protected]> Date: Fri Apr 23 18:35:34 2021 +0800 fix(pitcher): css-loader >= v4 compat css module with css-loader `esmodule: true`
1 parent 4240e5b commit ff7612d

File tree

4 files changed

+41
-8
lines changed

4 files changed

+41
-8
lines changed

Diff for: lib/codegen/styleInjection.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,14 @@ module.exports = function genStyleInjectionCode (
4040

4141
// `(vue-)style-loader` exports the name-to-hash map directly
4242
// `css-loader` exports it in `.locals`
43-
const locals = `(style${i}.locals || style${i})`
43+
const locals = `(styleTemp${i}.default || styleTemp${i}.locals || styleTemp${i})`
4444
const name = JSON.stringify(moduleName)
4545

4646
if (!needsHotReload) {
4747
styleInjectionCode += `this[${name}] = ${locals}\n`
4848
} else {
4949
styleInjectionCode += `
50+
const styleTemp${i} = style${i};
5051
cssModules[${name}] = ${locals}
5152
Object.defineProperty(this, ${name}, {
5253
configurable: true,
@@ -81,7 +82,7 @@ module.exports = function genStyleInjectionCode (
8182
// do not generate requests for empty styles
8283
if (isNotEmptyStyle(style)) {
8384
const request = genStyleRequest(style, i)
84-
styleImportsCode += `import style${i} from ${request}\n`
85+
styleImportsCode += `import * as style${i} from ${request}\n`
8586
if (style.module) genCSSModulesCode(style, request, i)
8687
}
8788
})

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"eslint": "^4.19.0",
6767
"eslint-plugin-vue-libs": "^2.1.0",
6868
"file-loader": "^1.1.11",
69-
"html-webpack-plugin": "4.0.0-beta.14",
69+
"html-webpack-plugin": "^4.5.2",
7070
"javascript-stringify": "^1.6.0",
7171
"jest": "^23.5.0",
7272
"jsdom": "^11.6.2",

Diff for: test/utils.js

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ const { createFsFromVolume, Volume } = require('memfs')
99
const mfs = createFsFromVolume(new Volume())
1010
const VueLoaderPlugin = require('../lib/plugin')
1111

12+
jest.setTimeout(30000)
13+
1214
const baseConfig = {
1315
mode: 'development',
1416
devtool: false,

Diff for: yarn.lock

+35-5
Original file line numberDiff line numberDiff line change
@@ -808,6 +808,11 @@
808808
"@types/minimatch" "*"
809809
"@types/node" "*"
810810

811+
"@types/html-minifier-terser@^5.0.0":
812+
version "5.1.1"
813+
resolved "https://registry.yarnpkg.com/@types/html-minifier-terser/-/html-minifier-terser-5.1.1.tgz#3c9ee980f1a10d6021ae6632ca3e79ca2ec4fb50"
814+
integrity sha512-giAlZwstKbmvMk1OO7WXSj4OZ0keXAcl2TQq4LWHiiPH2ByaH7WeUzng+Qej8UPxxv+8lRTuouo0iaNDBuzIBA==
815+
811816
"@types/minimatch@*":
812817
version "3.0.3"
813818
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d"
@@ -828,6 +833,11 @@
828833
resolved "https://registry.yarnpkg.com/@types/tapable/-/tapable-1.0.5.tgz#9adbc12950582aa65ead76bffdf39fe0c27a3c02"
829834
integrity sha512-/gG2M/Imw7cQFp8PGvz/SwocNrmKFjFsm5Pb8HdbHkZ1K8pmuPzOX4VeVoiEecFCVf4CsN1r3/BRvx+6sNqwtQ==
830835

836+
"@types/tapable@^1", "@types/tapable@^1.0.5":
837+
version "1.0.7"
838+
resolved "https://registry.yarnpkg.com/@types/tapable/-/tapable-1.0.7.tgz#545158342f949e8fd3bfd813224971ecddc3fac4"
839+
integrity sha512-0VBprVqfgFD7Ehb2vd8Lh9TG3jP98gvr8rgehQqzztZNI7o8zS8Ad4jyZneKELphpuE212D8J70LnSNQSyO6bQ==
840+
831841
"@types/uglify-js@*":
832842
version "3.0.4"
833843
resolved "https://registry.yarnpkg.com/@types/uglify-js/-/uglify-js-3.0.4.tgz#96beae23df6f561862a830b4288a49e86baac082"
@@ -856,6 +866,18 @@
856866
"@types/webpack-sources" "*"
857867
source-map "^0.6.0"
858868

869+
"@types/webpack@^4.41.8":
870+
version "4.41.28"
871+
resolved "https://registry.yarnpkg.com/@types/webpack/-/webpack-4.41.28.tgz#0069a2159b7ad4d83d0b5801942c17d54133897b"
872+
integrity sha512-Nn84RAiJjKRfPFFCVR8LC4ueTtTdfWAMZ03THIzZWRJB+rX24BD3LqPSFnbMscWauEsT4segAsylPDIaZyZyLQ==
873+
dependencies:
874+
"@types/anymatch" "*"
875+
"@types/node" "*"
876+
"@types/tapable" "^1"
877+
"@types/uglify-js" "*"
878+
"@types/webpack-sources" "*"
879+
source-map "^0.6.0"
880+
859881
860882
version "3.0.0-beta.11"
861883
resolved "https://registry.yarnpkg.com/@vue/babel-preset-app/-/babel-preset-app-3.0.0-beta.11.tgz#c8b889aa73464050f9cd3f9dc621951d85c24508"
@@ -5516,14 +5538,17 @@ html-minifier@^3.2.3:
55165538
relateurl "0.2.x"
55175539
uglify-js "3.4.x"
55185540

5519-
html-webpack-plugin@4.0.0-beta.14:
5520-
version "4.0.0-beta.14"
5521-
resolved "https://registry.yarnpkg.com/html-webpack-plugin/-/html-webpack-plugin-4.0.0-beta.14.tgz#1d3dc299a89391c6fb84c6ed94e7ebe53a9261a0"
5522-
integrity sha512-gdThA8oCH7PbHMbezNW5LD+hjxXTzwhfi4XFDKKo5Gs0BR1IhVChEZN1ub4YEKQBmOYasdnCGGPEOFggdm9hNA==
5541+
html-webpack-plugin@^4.5.2:
5542+
version "4.5.2"
5543+
resolved "https://registry.yarnpkg.com/html-webpack-plugin/-/html-webpack-plugin-4.5.2.tgz#76fc83fa1a0f12dd5f7da0404a54e2699666bc12"
5544+
integrity sha512-q5oYdzjKUIPQVjOosjgvCHQOv9Ett9CYYHlgvJeXG0qQvdSojnBq4vAdQBwn1+yGveAwHCoe/rMR86ozX3+c2A==
55235545
dependencies:
5546+
"@types/html-minifier-terser" "^5.0.0"
5547+
"@types/tapable" "^1.0.5"
5548+
"@types/webpack" "^4.41.8"
55245549
html-minifier-terser "^5.0.1"
55255550
loader-utils "^1.2.3"
5526-
lodash "^4.17.15"
5551+
lodash "^4.17.20"
55275552
pretty-error "^2.1.1"
55285553
tapable "^1.1.3"
55295554
util.promisify "1.0.0"
@@ -7223,6 +7248,11 @@ lodash@^4.0.0, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.1
72237248
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
72247249
integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==
72257250

7251+
lodash@^4.17.20:
7252+
version "4.17.21"
7253+
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
7254+
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
7255+
72267256
log-symbols@^1.0.2:
72277257
version "1.0.2"
72287258
resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-1.0.2.tgz#376ff7b58ea3086a0f09facc74617eca501e1a18"

0 commit comments

Comments
 (0)