Skip to content

Commit 5ad9a7d

Browse files
chore: update
1 parent 613da95 commit 5ad9a7d

File tree

9 files changed

+260
-302
lines changed

9 files changed

+260
-302
lines changed

package-lock.json

Lines changed: 213 additions & 237 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@
4545
"dependencies": {
4646
"camelcase": "^6.0.0",
4747
"cssesc": "^3.0.0",
48-
"icss-utils": "^4.1.1",
48+
"icss-utils": "^5.0.0-rc.0",
4949
"loader-utils": "^2.0.0",
50-
"postcss": "^8.0.6",
51-
"postcss-modules-extract-imports": "^3.0.0-rc.0",
52-
"postcss-modules-local-by-default": "^4.0.0-rc.0",
53-
"postcss-modules-scope": "^3.0.0-rc.0",
54-
"postcss-modules-values": "^4.0.0-rc.0",
50+
"postcss": "^8.0.7",
51+
"postcss-modules-extract-imports": "^3.0.0-rc.1",
52+
"postcss-modules-local-by-default": "^4.0.0-rc.1",
53+
"postcss-modules-scope": "^3.0.0-rc.1",
54+
"postcss-modules-values": "^4.0.0-rc.2",
5555
"postcss-value-parser": "^4.1.0",
5656
"schema-utils": "^2.7.1",
5757
"semver": "^7.3.2"
@@ -64,11 +64,12 @@
6464
"@commitlint/config-conventional": "^11.0.0",
6565
"@webpack-contrib/defaults": "^6.3.0",
6666
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
67+
"autoprefixer": "^10.0.0",
6768
"babel-jest": "^26.1.0",
6869
"cross-env": "^7.0.2",
6970
"del": "^5.1.0",
7071
"del-cli": "^3.0.1",
71-
"es-check": "^5.1.0",
72+
"es-check": "^5.1.1",
7273
"eslint": "^7.9.0",
7374
"eslint-config-prettier": "^6.11.0",
7475
"eslint-plugin-import": "^2.22.0",
@@ -84,15 +85,15 @@
8485
"postcss-loader": "^4.0.2",
8586
"postcss-preset-env": "^6.7.0",
8687
"prettier": "^2.1.2",
87-
"sass": "^1.26.10",
88+
"sass": "^1.26.11",
8889
"sass-loader": "^10.0.2",
8990
"standard-version": "^9.0.0",
9091
"strip-ansi": "^6.0.0",
9192
"style-loader": "^1.2.1",
9293
"stylus": "^0.54.8",
9394
"stylus-loader": "^3.0.2",
9495
"url-loader": "^4.1.0",
95-
"webpack": "^4.44.1"
96+
"webpack": "^4.44.2"
9697
},
9798
"keywords": [
9899
"webpack",

test/__snapshots__/loader.test.js.snap

Lines changed: 15 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(false);
5151
var ___CSS_LOADER_URL_REPLACEMENT_0___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_0___);
5252
var ___CSS_LOADER_URL_REPLACEMENT_1___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_1___);
5353
// Module
54-
___CSS_LOADER_EXPORT___.push([module.id, \\":root {\\\\n --fontSize: 1rem;\\\\n --mainColor: rgba(18,52,86,0.47059);\\\\n --secondaryColor: rgba(102, 51, 153, 0.9);\\\\n}\\\\n\\\\nhtml {\\\\n overflow-x: hidden;\\\\n overflow-y: auto;\\\\n overflow: hidden auto;\\\\n}\\\\n\\\\n@media (max-width: 50rem) {\\\\n body {\\\\n color: rgba(18,52,86,0.47059);\\\\n color: var(--mainColor);\\\\n font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;\\\\n font-size: 1rem;\\\\n font-size: var(--fontSize);\\\\n line-height: calc(1rem * 1.5);\\\\n line-height: calc(var(--fontSize) * 1.5);\\\\n word-wrap: break-word;\\\\n padding-left: calc(1rem / 2 + 1px);\\\\n padding-right: calc(1rem / 2 + 1px);\\\\n padding-left: calc(var(--fontSize) / 2 + 1px);\\\\n padding-right: calc(var(--fontSize) / 2 + 1px);\\\\n }\\\\n}\\\\n\\\\nh1,h2,h3,h4,h5,h6 {\\\\n margin-top: 0;\\\\n margin-bottom: 0;\\\\n}\\\\n\\\\nmain.hero, .hero.main {\\\\n background-image: url(\\" + ___CSS_LOADER_URL_REPLACEMENT_0___ + \\");\\\\n}\\\\n\\\\n@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {\\\\n\\\\nmain.hero, .hero.main {\\\\n background-image: url(\\" + ___CSS_LOADER_URL_REPLACEMENT_1___ + \\");\\\\n}\\\\n}\\\\n\\\\nmain.hero, .hero.main {\\\\n background-image: -webkit-image-set(url(\\" + ___CSS_LOADER_URL_REPLACEMENT_0___ + \\") 1x, url(\\" + ___CSS_LOADER_URL_REPLACEMENT_1___ + \\") 2x);\\\\n background-image: image-set(url(\\" + ___CSS_LOADER_URL_REPLACEMENT_0___ + \\") 1x, url(\\" + ___CSS_LOADER_URL_REPLACEMENT_1___ + \\") 2x);\\\\n}\\\\n\\\\na {\\\\n color: rgba(0, 0, 255, 0.9)\\\\n}\\\\n\\\\na:hover {\\\\n color: #639;\\\\n }\\\\n\\", \\"\\"]);
54+
___CSS_LOADER_EXPORT___.push([module.id, \\"::-moz-placeholder {\\\\n color: gray;\\\\n}\\\\n\\\\n:-ms-input-placeholder {\\\\n color: gray;\\\\n}\\\\n\\\\n::placeholder {\\\\n color: gray;\\\\n}\\\\n\\\\n.image {\\\\n background-image: url(\\" + ___CSS_LOADER_URL_REPLACEMENT_0___ + \\");\\\\n}\\\\n\\\\n@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {\\\\n .image {\\\\n background-image: url(\\" + ___CSS_LOADER_URL_REPLACEMENT_1___ + \\");\\\\n }\\\\n}\\", \\"\\"]);
5555
// Exports
5656
export default ___CSS_LOADER_EXPORT___;
5757
"
@@ -60,65 +60,28 @@ export default ___CSS_LOADER_EXPORT___;
6060
exports[`loader should reuse \`ast\` from "postcss-loader": result 1`] = `
6161
Array [
6262
Array [
63-
"./postcss-present-env/source.css",
64-
":root {
65-
--fontSize: 1rem;
66-
--mainColor: rgba(18,52,86,0.47059);
67-
--secondaryColor: rgba(102, 51, 153, 0.9);
63+
"./autoprefixer/autoprefixer.css",
64+
"::-moz-placeholder {
65+
color: gray;
6866
}
6967
70-
html {
71-
overflow-x: hidden;
72-
overflow-y: auto;
73-
overflow: hidden auto;
74-
}
75-
76-
@media (max-width: 50rem) {
77-
body {
78-
color: rgba(18,52,86,0.47059);
79-
color: var(--mainColor);
80-
font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;
81-
font-size: 1rem;
82-
font-size: var(--fontSize);
83-
line-height: calc(1rem * 1.5);
84-
line-height: calc(var(--fontSize) * 1.5);
85-
word-wrap: break-word;
86-
padding-left: calc(1rem / 2 + 1px);
87-
padding-right: calc(1rem / 2 + 1px);
88-
padding-left: calc(var(--fontSize) / 2 + 1px);
89-
padding-right: calc(var(--fontSize) / 2 + 1px);
90-
}
91-
}
92-
93-
h1,h2,h3,h4,h5,h6 {
94-
margin-top: 0;
95-
margin-bottom: 0;
96-
}
97-
98-
main.hero, .hero.main {
99-
background-image: url(/webpack/public/path/img1x.png);
100-
}
101-
102-
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
103-
104-
main.hero, .hero.main {
105-
background-image: url(/webpack/public/path/img2x.png);
106-
}
68+
:-ms-input-placeholder {
69+
color: gray;
10770
}
10871
109-
main.hero, .hero.main {
110-
background-image: -webkit-image-set(url(/webpack/public/path/img1x.png) 1x, url(/webpack/public/path/img2x.png) 2x);
111-
background-image: image-set(url(/webpack/public/path/img1x.png) 1x, url(/webpack/public/path/img2x.png) 2x);
72+
::placeholder {
73+
color: gray;
11274
}
11375
114-
a {
115-
color: rgba(0, 0, 255, 0.9)
76+
.image {
77+
background-image: url(/webpack/public/path/img1x.png);
11678
}
11779
118-
a:hover {
119-
color: #639;
120-
}
121-
",
80+
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {
81+
.image {
82+
background-image: url(/webpack/public/path/img2x.png);
83+
}
84+
}",
12285
"",
12386
],
12487
]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
::placeholder {
2+
color: gray;
3+
}
4+
5+
.image {
6+
background-image: url('./img1x.png');
7+
}
8+
9+
@media (min-resolution: 2dppx) {
10+
.image {
11+
background-image: url('./img2x.png');
12+
}
13+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import css from './autoprefixer.css';
2+
3+
__export__ = css;
4+
5+
export default css;

test/fixtures/autoprefixer/img1x.png

76.3 KB
Loading

test/fixtures/autoprefixer/img2x.png

76.3 KB
Loading

test/helpers/ast-loader.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import postcss from 'postcss';
2-
import postcssPresetEnv from 'postcss-preset-env';
2+
import autoprefixer from 'autoprefixer';
33
import postcssPkg from 'postcss/package.json';
44
import semver from 'semver';
55

@@ -10,7 +10,7 @@ export default function astLoader(content) {
1010

1111
const { spy = jest.fn() } = this.query;
1212

13-
postcss([postcssPresetEnv({ stage: 0 })])
13+
postcss([autoprefixer()])
1414
.process(content, {
1515
// eslint-disable-next-line no-undefined
1616
from: undefined,

test/loader.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ describe('loader', () => {
138138
it('should reuse `ast` from "postcss-loader"', async () => {
139139
const spy = jest.fn();
140140
const compiler = getCompiler(
141-
'./postcss-present-env/source.js',
141+
'./autoprefixer/autoprefixer.js',
142142
{},
143143
{
144144
module: {
@@ -170,7 +170,7 @@ describe('loader', () => {
170170
expect(spy).toHaveBeenCalledTimes(1);
171171

172172
expect(
173-
getModuleSource('./postcss-present-env/source.css', stats)
173+
getModuleSource('./autoprefixer/autoprefixer.css', stats)
174174
).toMatchSnapshot('module');
175175
expect(getExecutedCode('main.bundle.js', compiler, stats)).toMatchSnapshot(
176176
'result'

0 commit comments

Comments
 (0)