@merkur/plugin-css-scrambler 0.32.0 → 0.33.0
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/index.cjs +1 -1
- package/lib/index.js +1 -1
- package/lib/index.mjs +1 -1
- package/package.json +2 -2
- package/postcss/index.js +5 -5
package/lib/index.cjs
CHANGED
package/lib/index.js
CHANGED
package/lib/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@merkur/plugin-css-scrambler",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.33.0",
|
|
4
4
|
"description": "Merkur plugin for scrambling CSS classes.",
|
|
5
5
|
"main": "lib/index",
|
|
6
6
|
"module": "lib/index",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"classnames": "^2.3.2",
|
|
66
66
|
"postcss-selector-parser": "^6.0.12"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "3e88b57abfad267ac3f3b20b2ae6bf50f93f5375"
|
|
69
69
|
}
|
package/postcss/index.js
CHANGED
|
@@ -24,7 +24,7 @@ function postCssScrambler(options) {
|
|
|
24
24
|
fs.writeFileSync(options.hashTable, JSON.stringify(tableData));
|
|
25
25
|
} else {
|
|
26
26
|
[prefixesTable, mainPartsTable] = JSON.parse(
|
|
27
|
-
fs.readFileSync(options.hashTable)
|
|
27
|
+
fs.readFileSync(options.hashTable),
|
|
28
28
|
);
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -45,7 +45,7 @@ function postCssScrambler(options) {
|
|
|
45
45
|
const mainPartIndex = mainPartsTable.indexOf(mainPart);
|
|
46
46
|
if (prefixIndex === -1 || mainPartIndex === -1) {
|
|
47
47
|
throw new Error(
|
|
48
|
-
`The ${className} CSS class in not in the hash table
|
|
48
|
+
`The ${className} CSS class in not in the hash table`,
|
|
49
49
|
);
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -124,7 +124,7 @@ function applyPostCssScramblePlugin(options) {
|
|
|
124
124
|
generateHashTable: true,
|
|
125
125
|
hashTable: path.resolve(
|
|
126
126
|
process.env.WIDGET_DIRNAME,
|
|
127
|
-
'./build/static/hashtable.json'
|
|
127
|
+
'./build/static/hashtable.json',
|
|
128
128
|
),
|
|
129
129
|
...options,
|
|
130
130
|
});
|
|
@@ -137,7 +137,7 @@ function applyPostCssScramblePlugin(options) {
|
|
|
137
137
|
|
|
138
138
|
const postCssUseEntryIndex = rule.use.findIndex(
|
|
139
139
|
(useEntry) =>
|
|
140
|
-
useEntry === 'postcss-loader' || useEntry.loader === 'postcss-loader'
|
|
140
|
+
useEntry === 'postcss-loader' || useEntry.loader === 'postcss-loader',
|
|
141
141
|
);
|
|
142
142
|
|
|
143
143
|
if (~postCssUseEntryIndex) {
|
|
@@ -173,7 +173,7 @@ function applyPostCssScramblePlugin(options) {
|
|
|
173
173
|
|
|
174
174
|
// add postcss loader to rule matching css files
|
|
175
175
|
const cssRuleIndex = config.module.rules.findIndex((rule) =>
|
|
176
|
-
rule.test.test('.css')
|
|
176
|
+
rule.test.test('.css'),
|
|
177
177
|
);
|
|
178
178
|
|
|
179
179
|
if (~cssRuleIndex) {
|