svelte-preprocess-import-assets
Advanced tools
Comparing version 0.2.5 to 0.2.6
@@ -20,2 +20,6 @@ var __create = Object.create; | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
// If the importer is in node compatibility mode or this is not an ESM | ||
// file that has been converted to a CommonJS file using a Babel- | ||
// compatible transform (i.e. "__esModule" has not been set), then set | ||
// "default" to the CommonJS "module.exports" for node compatibility. | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | ||
@@ -224,3 +228,5 @@ mod | ||
} | ||
} else if (node.type === "Element" || hasCustomSources && node.type === "InlineComponent") { | ||
} else if (node.type === "Element" || // check component only when have custom sources, as the default object | ||
// does not support component names (optimization) | ||
hasCustomSources && node.type === "InlineComponent") { | ||
let getAttributes = function() { | ||
@@ -230,2 +236,4 @@ if (!lazyAttributes) { | ||
node.attributes.forEach((attr) => { | ||
if (attr.type !== "Attribute") | ||
return; | ||
if (attr.value.length > 1 && attr.value[0].type !== "Text") | ||
@@ -247,3 +255,5 @@ return; | ||
let getAttrValue = function(attr) { | ||
const attribute = node.attributes.find((v) => v.name === attr); | ||
const attribute = node.attributes.find( | ||
(v) => v.type === "Attribute" && v.name === attr | ||
); | ||
if (!attribute) | ||
@@ -297,3 +307,3 @@ return; | ||
} else { | ||
s.append(`<script>${importText}<\/script>`); | ||
s.append(`<script>${importText}</script>`); | ||
} | ||
@@ -300,0 +310,0 @@ } |
{ | ||
"name": "svelte-preprocess-import-assets", | ||
"description": "Import assets in markup", | ||
"version": "0.2.5", | ||
"version": "0.2.6", | ||
"license": "MIT", | ||
@@ -12,2 +12,3 @@ "author": "Bjorn Lu", | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"import": "./dist/index.mjs", | ||
@@ -36,3 +37,3 @@ "require": "./dist/index.js" | ||
"dependencies": { | ||
"magic-string": "^0.27.0", | ||
"magic-string": "^0.30.0", | ||
"svelte-parse-markup": "^0.1.1" | ||
@@ -44,11 +45,11 @@ }, | ||
"devDependencies": { | ||
"@types/node": "^18.11.10", | ||
"prettier": "^2.8.0", | ||
"prettier-plugin-svelte": "^2.8.1", | ||
"sass": "^1.56.1", | ||
"svelte": "^3.53.1", | ||
"svelte-preprocess": "^4.10.7", | ||
"@types/node": "^18.14.0", | ||
"prettier": "^2.8.4", | ||
"prettier-plugin-svelte": "^2.9.0", | ||
"sass": "^1.58.3", | ||
"svelte": "^3.55.1", | ||
"svelte-preprocess": "^5.0.1", | ||
"tsm": "^2.3.0", | ||
"tsup": "^6.5.0", | ||
"typescript": "^4.9.3", | ||
"tsup": "^6.6.3", | ||
"typescript": "^4.9.5", | ||
"uvu": "^0.5.6" | ||
@@ -55,0 +56,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34535
7
926
+ Addedmagic-string@0.30.12(transitive)
- Removedmagic-string@0.27.0(transitive)
Updatedmagic-string@^0.30.0