@atlaspack/transformer-svg
Advanced tools
Comparing version 2.12.1-dev.3367 to 2.12.1-dev.3398
@@ -78,16 +78,16 @@ "use strict"; | ||
delete attrs.type; | ||
let atlaspackKey; | ||
let parcelKey; | ||
// allow a script/style tag to declare its key | ||
if (attrs['data-atlaspack-key']) { | ||
atlaspackKey = attrs['data-atlaspack-key']; | ||
if (attrs['data-parcel-key']) { | ||
parcelKey = attrs['data-parcel-key']; | ||
} else { | ||
atlaspackKey = (0, _rust().hashString)(`${asset.id}:${key++}`); | ||
parcelKey = (0, _rust().hashString)(`${asset.id}:${key++}`); | ||
} | ||
// insert atlaspackId to allow us to retrieve node during packaging | ||
attrs['data-atlaspack-key'] = atlaspackKey; | ||
// insert parcelId to allow us to retrieve node during packaging | ||
attrs['data-parcel-key'] = parcelKey; | ||
asset.setAST(ast); // mark dirty | ||
asset.addDependency({ | ||
specifier: atlaspackKey, | ||
specifier: parcelKey, | ||
specifierType: 'esm' | ||
@@ -98,3 +98,3 @@ }); | ||
content: value, | ||
uniqueKey: atlaspackKey, | ||
uniqueKey: parcelKey, | ||
bundleBehavior: 'inline', | ||
@@ -115,5 +115,5 @@ env, | ||
if (attrs != null && style != null) { | ||
let atlaspackKey = (0, _rust().hashString)(`${asset.id}:${key++}`); | ||
let parcelKey = (0, _rust().hashString)(`${asset.id}:${key++}`); | ||
attrs.style = asset.addDependency({ | ||
specifier: atlaspackKey, | ||
specifier: parcelKey, | ||
specifierType: 'esm' | ||
@@ -126,3 +126,3 @@ }); | ||
content: style, | ||
uniqueKey: atlaspackKey, | ||
uniqueKey: parcelKey, | ||
bundleBehavior: 'inline', | ||
@@ -129,0 +129,0 @@ meta: { |
{ | ||
"name": "@atlaspack/transformer-svg", | ||
"version": "2.12.1-dev.3367+07fefed65", | ||
"version": "2.12.1-dev.3398+81c73b3cd", | ||
"license": "MIT", | ||
@@ -16,8 +16,8 @@ "publishConfig": { | ||
"node": ">= 16.0.0", | ||
"atlaspack": "^2.12.1-dev.3367+07fefed65" | ||
"parcel": "^2.12.1-dev.3398+81c73b3cd" | ||
}, | ||
"dependencies": { | ||
"@atlaspack/diagnostic": "2.12.1-dev.3367+07fefed65", | ||
"@atlaspack/plugin": "2.12.1-dev.3367+07fefed65", | ||
"@atlaspack/rust": "2.12.1-dev.3367+07fefed65", | ||
"@atlaspack/diagnostic": "2.12.1-dev.3398+81c73b3cd", | ||
"@atlaspack/plugin": "2.12.1-dev.3398+81c73b3cd", | ||
"@atlaspack/rust": "2.12.1-dev.3398+81c73b3cd", | ||
"nullthrows": "^1.1.1", | ||
@@ -29,3 +29,3 @@ "posthtml": "^0.16.5", | ||
}, | ||
"gitHead": "07fefed65a9a4d7bd0bdc9c45b39704ee4ca70dd" | ||
"gitHead": "81c73b3cdf93adf8b0013be9fed5422579bd5910" | ||
} |
@@ -76,16 +76,16 @@ // @flow | ||
let atlaspackKey; | ||
let parcelKey; | ||
// allow a script/style tag to declare its key | ||
if (attrs['data-atlaspack-key']) { | ||
atlaspackKey = attrs['data-atlaspack-key']; | ||
if (attrs['data-parcel-key']) { | ||
parcelKey = attrs['data-parcel-key']; | ||
} else { | ||
atlaspackKey = hashString(`${asset.id}:${key++}`); | ||
parcelKey = hashString(`${asset.id}:${key++}`); | ||
} | ||
// insert atlaspackId to allow us to retrieve node during packaging | ||
attrs['data-atlaspack-key'] = atlaspackKey; | ||
// insert parcelId to allow us to retrieve node during packaging | ||
attrs['data-parcel-key'] = parcelKey; | ||
asset.setAST(ast); // mark dirty | ||
asset.addDependency({ | ||
specifier: atlaspackKey, | ||
specifier: parcelKey, | ||
specifierType: 'esm', | ||
@@ -97,3 +97,3 @@ }); | ||
content: value, | ||
uniqueKey: atlaspackKey, | ||
uniqueKey: parcelKey, | ||
bundleBehavior: 'inline', | ||
@@ -114,5 +114,5 @@ env, | ||
if (attrs != null && style != null) { | ||
let atlaspackKey = hashString(`${asset.id}:${key++}`); | ||
let parcelKey = hashString(`${asset.id}:${key++}`); | ||
attrs.style = asset.addDependency({ | ||
specifier: atlaspackKey, | ||
specifier: parcelKey, | ||
specifierType: 'esm', | ||
@@ -125,3 +125,3 @@ }); | ||
content: style, | ||
uniqueKey: atlaspackKey, | ||
uniqueKey: parcelKey, | ||
bundleBehavior: 'inline', | ||
@@ -128,0 +128,0 @@ meta: { |
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
33229