@plumeria/compiler 19.1.5 → 19.1.7

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 +8 -4
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -292,6 +292,13 @@ function compileCSS(options) {
292
292
  const actualPath = (0, utils_1.resolveImportPath)(sourcePath, resourcePath);
293
293
  if (actualPath) {
294
294
  node.specifiers.forEach((specifier) => {
295
+ if (specifier.type === 'ImportNamespaceSpecifier') {
296
+ localImports[specifier.local.value] = {
297
+ actualPath,
298
+ importedName: '*',
299
+ };
300
+ return;
301
+ }
295
302
  if (specifier.type === 'ImportSpecifier' ||
296
303
  specifier.type === 'ImportDefaultSpecifier') {
297
304
  const importedName = specifier.type === 'ImportDefaultSpecifier'
@@ -591,10 +598,7 @@ function compileCSS(options) {
591
598
  (ctx.localCreateStyles[rootId] !== undefined ||
592
599
  ctx.mergedCreateTable[rootId] !== undefined);
593
600
  if (!isPlumeriaStyle) {
594
- const origin = rootId ? localImports[rootId] : undefined;
595
- const failure = origin
596
- ? (0, utils_1.resolveFileError)(origin.actualPath, origin.importedName)
597
- : undefined;
601
+ const failure = (0, utils_1.resolveOriginError)(node, rootId, localImports);
598
602
  throw new Error(failure
599
603
  ? `[plumeria] ${failure.message} (${path.basename(failure.filePath)})`
600
604
  : `[plumeria] Dynamic or unresolvable style object "${getSource(node)}" is not supported. (${path.basename(resourcePath)})`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plumeria/compiler",
3
- "version": "19.1.5",
3
+ "version": "19.1.7",
4
4
  "description": "Plumeria swc based compiler for statically extracting css",
5
5
  "author": "Refirst 11",
6
6
  "license": "MIT",
@@ -21,7 +21,7 @@
21
21
  "dist/"
22
22
  ],
23
23
  "dependencies": {
24
- "@plumeria/utils": "^19.1.5"
24
+ "@plumeria/utils": "^19.1.7"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@rust-gear/glob": "1.2.1",