@parcel/transformer-css 2.0.0-nightly.982 → 2.0.0-nightly.986
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/CSSTransformer.js +14 -13
- package/package.json +9 -10
- package/src/CSSTransformer.js +4 -3
package/lib/CSSTransformer.js
CHANGED
|
@@ -85,10 +85,10 @@ function _postcssModules() {
|
|
|
85
85
|
return data;
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
function
|
|
89
|
-
const data = _interopRequireDefault(require("
|
|
88
|
+
function _loader() {
|
|
89
|
+
const data = _interopRequireDefault(require("postcss-modules/build/css-loader-core/loader"));
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
_loader = function () {
|
|
92
92
|
return data;
|
|
93
93
|
};
|
|
94
94
|
|
|
@@ -117,7 +117,7 @@ function _path() {
|
|
|
117
117
|
|
|
118
118
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
119
119
|
|
|
120
|
-
const URL_RE = /url\s*\(
|
|
120
|
+
const URL_RE = /url\s*\(/;
|
|
121
121
|
const IMPORT_RE = /@import/;
|
|
122
122
|
const COMPOSES_RE = /composes:.+from\s*("|').*("|')\s*;?/;
|
|
123
123
|
const FROM_IMPORT_RE = /.+from\s*(?:"|')(.*)(?:"|')\s*;?/;
|
|
@@ -262,14 +262,15 @@ var _default = new (_plugin().Transformer)({
|
|
|
262
262
|
parsed.walk(node => {
|
|
263
263
|
if (node.type === 'function' && node.value === 'url' && node.nodes.length > 0 && !node.nodes[0].value.startsWith('#') // IE's `behavior: url(#default#VML)`
|
|
264
264
|
) {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
265
|
+
let urlNode = node.nodes[0];
|
|
266
|
+
let url = asset.addURLDependency(urlNode.value, {
|
|
267
|
+
loc: decl.source && decl.source.start && createLoc(decl.source.start, urlNode.value, 0, decl.source.start.offset + urlNode.sourceIndex + 1, 0)
|
|
268
|
+
});
|
|
269
|
+
isDeclDirty = urlNode.value !== url;
|
|
270
|
+
urlNode.type = 'string';
|
|
271
|
+
urlNode.quote = '"';
|
|
272
|
+
urlNode.value = url;
|
|
273
|
+
}
|
|
273
274
|
});
|
|
274
275
|
|
|
275
276
|
if (isDeclDirty) {
|
|
@@ -410,7 +411,7 @@ async function compileCSSModules(asset, env, program, resolve, options) {
|
|
|
410
411
|
}
|
|
411
412
|
|
|
412
413
|
function createLoader(asset, resolve) {
|
|
413
|
-
return class extends
|
|
414
|
+
return class extends _loader().default {
|
|
414
415
|
async fetch(composesPath, relativeTo) {
|
|
415
416
|
let importPath = composesPath.replace(/^["']|["']$/g, '');
|
|
416
417
|
let resolved = await resolve(relativeTo, importPath);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parcel/transformer-css",
|
|
3
|
-
"version": "2.0.0-nightly.
|
|
3
|
+
"version": "2.0.0-nightly.986+74fcc3fb",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -17,19 +17,18 @@
|
|
|
17
17
|
"source": "src/CSSTransformer.js",
|
|
18
18
|
"engines": {
|
|
19
19
|
"node": ">= 12.0.0",
|
|
20
|
-
"parcel": "2.0.0-nightly.
|
|
20
|
+
"parcel": "2.0.0-nightly.984+74fcc3fb"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@parcel/hash": "2.2.
|
|
24
|
-
"@parcel/plugin": "2.0.0-nightly.
|
|
23
|
+
"@parcel/hash": "2.2.2-nightly.2609+74fcc3fb",
|
|
24
|
+
"@parcel/plugin": "2.0.0-nightly.986+74fcc3fb",
|
|
25
25
|
"@parcel/source-map": "^2.0.0",
|
|
26
|
-
"@parcel/utils": "2.0.0-nightly.
|
|
27
|
-
"css-modules-loader-core": "^1.1.0",
|
|
26
|
+
"@parcel/utils": "2.0.0-nightly.986+74fcc3fb",
|
|
28
27
|
"nullthrows": "^1.1.1",
|
|
29
|
-
"postcss": "^8.
|
|
30
|
-
"postcss-modules": "^3.
|
|
31
|
-
"postcss-value-parser": "^4.
|
|
28
|
+
"postcss": "^8.4.5",
|
|
29
|
+
"postcss-modules": "^4.3.0",
|
|
30
|
+
"postcss-value-parser": "^4.2.0",
|
|
32
31
|
"semver": "^5.7.1"
|
|
33
32
|
},
|
|
34
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "74fcc3fbe80cea993bff10e158df3d0f701973c7"
|
|
35
34
|
}
|
package/src/CSSTransformer.js
CHANGED
|
@@ -11,11 +11,11 @@ import postcss from 'postcss';
|
|
|
11
11
|
import nullthrows from 'nullthrows';
|
|
12
12
|
import valueParser from 'postcss-value-parser';
|
|
13
13
|
import postcssModules from 'postcss-modules';
|
|
14
|
-
import FileSystemLoader from '
|
|
14
|
+
import FileSystemLoader from 'postcss-modules/build/css-loader-core/loader';
|
|
15
15
|
import semver from 'semver';
|
|
16
16
|
import path from 'path';
|
|
17
17
|
|
|
18
|
-
const URL_RE = /url\s*\(
|
|
18
|
+
const URL_RE = /url\s*\(/;
|
|
19
19
|
const IMPORT_RE = /@import/;
|
|
20
20
|
const COMPOSES_RE = /composes:.+from\s*("|').*("|')\s*;?/;
|
|
21
21
|
const FROM_IMPORT_RE = /.+from\s*(?:"|')(.*)(?:"|')\s*;?/;
|
|
@@ -185,7 +185,8 @@ export default (new Transformer({
|
|
|
185
185
|
),
|
|
186
186
|
});
|
|
187
187
|
isDeclDirty = urlNode.value !== url;
|
|
188
|
-
urlNode.type = '
|
|
188
|
+
urlNode.type = 'string';
|
|
189
|
+
urlNode.quote = '"';
|
|
189
190
|
urlNode.value = url;
|
|
190
191
|
}
|
|
191
192
|
});
|