@atlaspack/transformer-postcss 2.12.1-dev.3443 → 2.12.1-dev.3460
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/package.json +7 -7
- package/src/PostCSSTransformer.js +7 -5
- package/src/loadConfig.js +3 -3
- package/src/loadPlugins.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/transformer-postcss",
|
|
3
|
-
"version": "2.12.1-dev.
|
|
3
|
+
"version": "2.12.1-dev.3460+340817991",
|
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
"source": "src/PostCSSTransformer.js",
|
|
14
14
|
"engines": {
|
|
15
15
|
"node": ">= 16.0.0",
|
|
16
|
-
"parcel": "^2.12.1-dev.
|
|
16
|
+
"parcel": "^2.12.1-dev.3460+340817991"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@atlaspack/diagnostic": "2.12.1-dev.
|
|
20
|
-
"@atlaspack/plugin": "2.12.1-dev.
|
|
21
|
-
"@atlaspack/rust": "2.12.1-dev.
|
|
22
|
-
"@atlaspack/utils": "2.12.1-dev.
|
|
19
|
+
"@atlaspack/diagnostic": "2.12.1-dev.3460+340817991",
|
|
20
|
+
"@atlaspack/plugin": "2.12.1-dev.3460+340817991",
|
|
21
|
+
"@atlaspack/rust": "2.12.1-dev.3460+340817991",
|
|
22
|
+
"@atlaspack/utils": "2.12.1-dev.3460+340817991",
|
|
23
23
|
"clone": "^2.1.1",
|
|
24
24
|
"nullthrows": "^1.1.1",
|
|
25
25
|
"postcss-value-parser": "^4.2.0",
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"postcss": "^8.4.5",
|
|
30
30
|
"postcss-modules": "^4.3.1"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "3408179911d6c67e2bdad99e545dd7a0a9a6782c"
|
|
33
33
|
}
|
|
@@ -183,12 +183,12 @@ export default (new Transformer({
|
|
|
183
183
|
);
|
|
184
184
|
|
|
185
185
|
if (code == null || COMPOSES_RE.test(code)) {
|
|
186
|
-
program.walkDecls(decl => {
|
|
186
|
+
program.walkDecls((decl) => {
|
|
187
187
|
let [, importPath] = FROM_IMPORT_RE.exec(decl.value) || [];
|
|
188
188
|
if (decl.prop === 'composes' && importPath != null) {
|
|
189
189
|
let parsed = valueParser(decl.value);
|
|
190
190
|
|
|
191
|
-
parsed.walk(node => {
|
|
191
|
+
parsed.walk((node) => {
|
|
192
192
|
if (node.type === 'string') {
|
|
193
193
|
asset.addDependency({
|
|
194
194
|
specifier: importPath,
|
|
@@ -238,12 +238,14 @@ export default (new Transformer({
|
|
|
238
238
|
let cssModulesList = (Object.entries(cssModules): Array<
|
|
239
239
|
[string, string],
|
|
240
240
|
>);
|
|
241
|
-
let deps = asset
|
|
241
|
+
let deps = asset
|
|
242
|
+
.getDependencies()
|
|
243
|
+
.filter((dep) => dep.priority === 'sync');
|
|
242
244
|
let code: string;
|
|
243
245
|
if (deps.length > 0) {
|
|
244
246
|
code = `
|
|
245
247
|
module.exports = Object.assign({}, ${deps
|
|
246
|
-
.map(dep => `require(${JSON.stringify(dep.specifier)})`)
|
|
248
|
+
.map((dep) => `require(${JSON.stringify(dep.specifier)})`)
|
|
247
249
|
.join(', ')}, ${JSON.stringify(cssModules, null, 2)});
|
|
248
250
|
`;
|
|
249
251
|
} else {
|
|
@@ -276,7 +278,7 @@ export default (new Transformer({
|
|
|
276
278
|
const postcss: Postcss = await loadPostcss(options, asset.filePath);
|
|
277
279
|
|
|
278
280
|
let code = '';
|
|
279
|
-
postcss.stringify(postcss.fromJSON(ast.program), c => {
|
|
281
|
+
postcss.stringify(postcss.fromJSON(ast.program), (c) => {
|
|
280
282
|
code += c;
|
|
281
283
|
});
|
|
282
284
|
|
package/src/loadConfig.js
CHANGED
|
@@ -74,7 +74,7 @@ async function configHydrator(
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
let redundantPlugins = pluginArray.filter(
|
|
77
|
-
p => p === 'autoprefixer' || p === 'postcss-preset-env',
|
|
77
|
+
(p) => p === 'autoprefixer' || p === 'postcss-preset-env',
|
|
78
78
|
);
|
|
79
79
|
if (redundantPlugins.length > 0) {
|
|
80
80
|
let filename = path.basename(resolveFrom);
|
|
@@ -87,7 +87,7 @@ async function configHydrator(
|
|
|
87
87
|
} else {
|
|
88
88
|
message = md`Parcel includes CSS transpilation and vendor prefixing by default. PostCSS config __${filename}__ contains the following redundant plugins: ${[
|
|
89
89
|
...redundantPlugins,
|
|
90
|
-
].map(p =>
|
|
90
|
+
].map((p) =>
|
|
91
91
|
md.underline(p),
|
|
92
92
|
)}. Removing these may improve build performance.`;
|
|
93
93
|
hints.push(md`Remove the above plugins from __${filename}__`);
|
|
@@ -104,7 +104,7 @@ async function configHydrator(
|
|
|
104
104
|
code: contents,
|
|
105
105
|
codeHighlights: generateJSONCodeHighlights(
|
|
106
106
|
contents,
|
|
107
|
-
redundantPlugins.map(plugin => ({
|
|
107
|
+
redundantPlugins.map((plugin) => ({
|
|
108
108
|
key: `${prefix}/plugins/${plugin}`,
|
|
109
109
|
type: 'key',
|
|
110
110
|
})),
|
package/src/loadPlugins.js
CHANGED
|
@@ -11,7 +11,7 @@ export default async function loadExternalPlugins(
|
|
|
11
11
|
if (Array.isArray(plugins)) {
|
|
12
12
|
return Promise.all(
|
|
13
13
|
plugins
|
|
14
|
-
.map(p =>
|
|
14
|
+
.map((p) =>
|
|
15
15
|
loadPlugin(
|
|
16
16
|
p,
|
|
17
17
|
relative,
|
|
@@ -25,7 +25,7 @@ export default async function loadExternalPlugins(
|
|
|
25
25
|
} else if (typeof plugins === 'object') {
|
|
26
26
|
let _plugins = plugins;
|
|
27
27
|
let mapPlugins = await Promise.all(
|
|
28
|
-
Object.keys(plugins).map(p =>
|
|
28
|
+
Object.keys(plugins).map((p) =>
|
|
29
29
|
loadPlugin(
|
|
30
30
|
p,
|
|
31
31
|
relative,
|