@plumeria/webpack-plugin 4.1.3 → 4.2.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.
Files changed (2) hide show
  1. package/dist/index.js +3 -16
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -21,16 +21,7 @@ function loader(source) {
21
21
  }
22
22
  this.clearDependencies();
23
23
  this.addDependency(this.resourcePath);
24
- utils_1.tables.staticTable = (0, utils_1.scanForCreateStatic)((path) => this.addDependency(path));
25
- const { keyframesHashTableLocal, keyframesObjectTableLocal } = (0, utils_1.scanForKeyframes)((path) => this.addDependency(path));
26
- utils_1.tables.keyframesHashTable = keyframesHashTableLocal;
27
- utils_1.tables.keyframesObjectTable = keyframesObjectTableLocal;
28
- const { viewTransitionHashTableLocal, viewTransitionObjectTableLocal } = (0, utils_1.scanForViewTransition)((path) => this.addDependency(path));
29
- utils_1.tables.viewTransitionHashTable = viewTransitionHashTableLocal;
30
- utils_1.tables.viewTransitionObjectTable = viewTransitionObjectTableLocal;
31
- const { themeTableLocal, createThemeObjectTableLocal } = (0, utils_1.scanForCreateTheme)((path) => this.addDependency(path));
32
- utils_1.tables.themeTable = themeTableLocal;
33
- utils_1.tables.createThemeObjectTable = createThemeObjectTableLocal;
24
+ (0, utils_1.scanAll)((path) => this.addDependency(path));
34
25
  const extractedSheets = [];
35
26
  const fileStyles = {};
36
27
  const ast = (0, core_1.parseSync)(source, {
@@ -38,7 +29,7 @@ function loader(source) {
38
29
  tsx: true,
39
30
  target: 'es2022',
40
31
  });
41
- const localConsts = (0, utils_1.collectLocalConsts)(ast);
32
+ const localConsts = (0, utils_1.collectLocalConsts)(ast, this.resourcePath);
42
33
  Object.assign(utils_1.tables.staticTable, localConsts);
43
34
  const isTSFile = this.resourcePath.endsWith('.ts') && !this.resourcePath.endsWith('.tsx');
44
35
  const localCreateStyles = {};
@@ -213,14 +204,10 @@ function loader(source) {
213
204
  return;
214
205
  const styleInfo = localCreateStyles[node.value];
215
206
  if (styleInfo && !styleInfo.hasDynamicAccess) {
216
- const fullHashMap = {};
217
- Object.entries(styleInfo.hashMap).forEach(([key, atomMap]) => {
218
- fullHashMap[key] = Object.values(atomMap).join(' ');
219
- });
220
207
  replacements.push({
221
208
  start: node.span.start - ast.span.start,
222
209
  end: node.span.end - ast.span.start,
223
- content: JSON.stringify(fullHashMap),
210
+ content: JSON.stringify(styleInfo.hashMap),
224
211
  });
225
212
  }
226
213
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plumeria/webpack-plugin",
3
- "version": "4.1.3",
3
+ "version": "4.2.0",
4
4
  "description": "Plumeria Webpack plugin",
5
5
  "author": "Refirst 11",
6
6
  "license": "MIT",
@@ -22,7 +22,7 @@
22
22
  "zero-virtual.css"
23
23
  ],
24
24
  "dependencies": {
25
- "@plumeria/utils": "^4.1.3"
25
+ "@plumeria/utils": "^4.2.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@swc/core": "1.15.8",