Skip to content

Commit 2c42cc8

Browse files
committed
fix(pitcher): css-loader >= v4 compat
1 parent 4240e5b commit 2c42cc8

File tree

3 files changed

+56
-18
lines changed

3 files changed

+56
-18
lines changed

Diff for: lib/codegen/styleInjection.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ 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 = `(style${i}.default || style${i}.locals || style${i})`
4444
const name = JSON.stringify(moduleName)
4545

4646
if (!needsHotReload) {
@@ -81,7 +81,7 @@ module.exports = function genStyleInjectionCode (
8181
// do not generate requests for empty styles
8282
if (isNotEmptyStyle(style)) {
8383
const request = genStyleRequest(style, i)
84-
styleImportsCode += `import style${i} from ${request}\n`
84+
styleImportsCode += `import * as style${i} from ${request}\n`
8585
if (style.module) genCSSModulesCode(style, request, i)
8686
}
8787
})

Diff for: package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@
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.0.0",
7070
"javascript-stringify": "^1.6.0",
7171
"jest": "^23.5.0",
7272
"jsdom": "^11.6.2",
7373
"json": "^9.0.6",
7474
"lint-staged": "^7.0.0",
7575
"markdown-loader": "^2.0.2",
76-
"memfs": "^3.1.2",
76+
"memfs": "^3.2.3",
7777
"mini-css-extract-plugin": "^0.4.1",
7878
"node-sass": "^4.7.2",
7979
"normalize-newline": "^3.0.0",

Diff for: yarn.lock

+52-14
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.2"
813+
resolved "https://registry.yarnpkg.com/@types/html-minifier-terser/-/html-minifier-terser-5.1.2.tgz#693b316ad323ea97eed6b38ed1a3cc02b1672b57"
814+
integrity sha512-h4lTMgMJctJybDp8CQrxTUiiYmedihHWkjnF/8Pxseu2S6Nlfcy8kwboQ8yejh456rP2yWoEVm1sS/FVsfM48w==
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.8"
838+
resolved "https://registry.yarnpkg.com/@types/tapable/-/tapable-1.0.8.tgz#b94a4391c85666c7b73299fd3ad79d4faa435310"
839+
integrity sha512-ipixuVrh2OdNmauvtT51o3d8z12p6LtFW9in7U79der/kwejjdNchQC5UMn5u/KxNoM7VHHOs/l8KS8uHxhODQ==
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.30"
871+
resolved "https://registry.yarnpkg.com/@types/webpack/-/webpack-4.41.30.tgz#fd3db6d0d41e145a8eeeafcd3c4a7ccde9068ddc"
872+
integrity sha512-GUHyY+pfuQ6haAfzu4S14F+R5iGRwN6b2FRNJY7U0NilmFAqbsOfK6j1HwuLBAqwRIT+pVdNDJGJ6e8rpp0KHA==
873+
dependencies:
874+
"@types/node" "*"
875+
"@types/tapable" "^1"
876+
"@types/uglify-js" "*"
877+
"@types/webpack-sources" "*"
878+
anymatch "^3.0.0"
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"
@@ -1302,6 +1324,14 @@ anymatch@^2.0.0:
13021324
micromatch "^3.1.4"
13031325
normalize-path "^2.1.1"
13041326

1327+
anymatch@^3.0.0:
1328+
version "3.1.2"
1329+
resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716"
1330+
integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==
1331+
dependencies:
1332+
normalize-path "^3.0.0"
1333+
picomatch "^2.0.4"
1334+
13051335
anymatch@~3.1.1:
13061336
version "3.1.1"
13071337
resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.1.tgz#c55ecf02185e2469259399310c173ce31233b142"
@@ -4935,10 +4965,10 @@ fs-extra@^5.0.0:
49354965
jsonfile "^4.0.0"
49364966
universalify "^0.1.0"
49374967

4938-
4939-
version "1.0.0"
4940-
resolved "https://registry.yarnpkg.com/fs-monkey/-/fs-monkey-1.0.0.tgz#b1fe36b2d8a78463fd0b8fd1463b355952743bd0"
4941-
integrity sha512-nxkkzQ5Ga+ETriXxIof4TncyMSzrV9jFIF+kGN16nw5CiAdWAnG/2FgM7CHhRenW1EBiDx+r1tf/P78HGKCgnA==
4968+
4969+
version "1.0.3"
4970+
resolved "https://registry.yarnpkg.com/fs-monkey/-/fs-monkey-1.0.3.tgz#ae3ac92d53bb328efe0e9a1d9541f6ad8d48e2d3"
4971+
integrity sha512-cybjIfiiE+pTWicSCLFHSrXZ6EilF30oh91FDP9S2B051prEa7QWfrVTQm10/dDpswBDXZugPa1Ogu8Yh+HV0Q==
49424972

49434973
fs-write-stream-atomic@^1.0.8:
49444974
version "1.0.10"
@@ -5516,14 +5546,17 @@ html-minifier@^3.2.3:
55165546
relateurl "0.2.x"
55175547
uglify-js "3.4.x"
55185548

5519-
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==
5549+
html-webpack-plugin@^4.0.0:
5550+
version "4.5.2"
5551+
resolved "https://registry.yarnpkg.com/html-webpack-plugin/-/html-webpack-plugin-4.5.2.tgz#76fc83fa1a0f12dd5f7da0404a54e2699666bc12"
5552+
integrity sha512-q5oYdzjKUIPQVjOosjgvCHQOv9Ett9CYYHlgvJeXG0qQvdSojnBq4vAdQBwn1+yGveAwHCoe/rMR86ozX3+c2A==
55235553
dependencies:
5554+
"@types/html-minifier-terser" "^5.0.0"
5555+
"@types/tapable" "^1.0.5"
5556+
"@types/webpack" "^4.41.8"
55245557
html-minifier-terser "^5.0.1"
55255558
loader-utils "^1.2.3"
5526-
lodash "^4.17.15"
5559+
lodash "^4.17.20"
55275560
pretty-error "^2.1.1"
55285561
tapable "^1.1.3"
55295562
util.promisify "1.0.0"
@@ -7223,6 +7256,11 @@ lodash@^4.0.0, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.1
72237256
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
72247257
integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==
72257258

7259+
lodash@^4.17.20:
7260+
version "4.17.21"
7261+
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
7262+
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
7263+
72267264
log-symbols@^1.0.2:
72277265
version "1.0.2"
72287266
resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-1.0.2.tgz#376ff7b58ea3086a0f09facc74617eca501e1a18"
@@ -7444,12 +7482,12 @@ mem@^4.0.0:
74447482
mimic-fn "^2.0.0"
74457483
p-is-promise "^2.0.0"
74467484

7447-
memfs@^3.1.2:
7448-
version "3.1.2"
7449-
resolved "https://registry.yarnpkg.com/memfs/-/memfs-3.1.2.tgz#2bb51600dacec67ed35677b1185abb708b7d2ad6"
7450-
integrity sha512-YubKuE+RGSdpZcRq2Nih8HcHj3LrqndsDFNB9IFjrgwzdM4eq+fImlDMfNm/HdRhYRkLdUecHGIpdz+wyrqlDg==
7485+
memfs@^3.2.3:
7486+
version "3.2.3"
7487+
resolved "https://registry.yarnpkg.com/memfs/-/memfs-3.2.3.tgz#a5cc1b11a0608f4e38feea9a94b957acba820af3"
7488+
integrity sha512-vDKa1icg0KDNzcOPBPAduFFb3YL+pLbQ/3hW7rRgUKpoliTAkPmVV7r/3qJ6YqKyIXEDhzsdSvLlEh137AfWUA==
74517489
dependencies:
7452-
fs-monkey "1.0.0"
7490+
fs-monkey "1.0.3"
74537491

74547492
memory-fs@^0.4.0, memory-fs@^0.4.1:
74557493
version "0.4.1"

0 commit comments

Comments
 (0)