@atlaspack/transformer-svg 2.12.1-dev.3365 → 2.12.1-dev.3398
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/inline.js +11 -11
- package/package.json +6 -6
- package/src/inline.js +11 -11
package/lib/inline.js
CHANGED
|
@@ -75,26 +75,26 @@ function extractInlineAssets(asset, ast) {
|
|
|
75
75
|
|
|
76
76
|
// Inform packager to remove type, since CSS and JS are the defaults.
|
|
77
77
|
delete attrs.type;
|
|
78
|
-
let
|
|
78
|
+
let parcelKey;
|
|
79
79
|
// allow a script/style tag to declare its key
|
|
80
|
-
if (attrs['data-
|
|
81
|
-
|
|
80
|
+
if (attrs['data-parcel-key']) {
|
|
81
|
+
parcelKey = attrs['data-parcel-key'];
|
|
82
82
|
} else {
|
|
83
|
-
|
|
83
|
+
parcelKey = (0, _rust().hashString)(`${asset.id}:${key++}`);
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
// insert
|
|
87
|
-
attrs['data-
|
|
86
|
+
// insert parcelId to allow us to retrieve node during packaging
|
|
87
|
+
attrs['data-parcel-key'] = parcelKey;
|
|
88
88
|
asset.setAST(ast); // mark dirty
|
|
89
89
|
|
|
90
90
|
asset.addDependency({
|
|
91
|
-
specifier:
|
|
91
|
+
specifier: parcelKey,
|
|
92
92
|
specifierType: 'esm'
|
|
93
93
|
});
|
|
94
94
|
parts.push({
|
|
95
95
|
type,
|
|
96
96
|
content: value,
|
|
97
|
-
uniqueKey:
|
|
97
|
+
uniqueKey: parcelKey,
|
|
98
98
|
bundleBehavior: 'inline',
|
|
99
99
|
env,
|
|
100
100
|
meta: {
|
|
@@ -110,9 +110,9 @@ function extractInlineAssets(asset, ast) {
|
|
|
110
110
|
let attrs = node.attrs;
|
|
111
111
|
let style = attrs === null || attrs === void 0 ? void 0 : attrs.style;
|
|
112
112
|
if (attrs != null && style != null) {
|
|
113
|
-
let
|
|
113
|
+
let parcelKey = (0, _rust().hashString)(`${asset.id}:${key++}`);
|
|
114
114
|
attrs.style = asset.addDependency({
|
|
115
|
-
specifier:
|
|
115
|
+
specifier: parcelKey,
|
|
116
116
|
specifierType: 'esm'
|
|
117
117
|
});
|
|
118
118
|
asset.setAST(ast); // mark dirty
|
|
@@ -120,7 +120,7 @@ function extractInlineAssets(asset, ast) {
|
|
|
120
120
|
parts.push({
|
|
121
121
|
type: 'css',
|
|
122
122
|
content: style,
|
|
123
|
-
uniqueKey:
|
|
123
|
+
uniqueKey: parcelKey,
|
|
124
124
|
bundleBehavior: 'inline',
|
|
125
125
|
meta: {
|
|
126
126
|
type: 'attr',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/transformer-svg",
|
|
3
|
-
"version": "2.12.1-dev.
|
|
3
|
+
"version": "2.12.1-dev.3398+81c73b3cd",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -13,17 +13,17 @@
|
|
|
13
13
|
"source": "src/SVGTransformer.js",
|
|
14
14
|
"engines": {
|
|
15
15
|
"node": ">= 16.0.0",
|
|
16
|
-
"
|
|
16
|
+
"parcel": "^2.12.1-dev.3398+81c73b3cd"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@atlaspack/diagnostic": "2.12.1-dev.
|
|
20
|
-
"@atlaspack/plugin": "2.12.1-dev.
|
|
21
|
-
"@atlaspack/rust": "2.12.1-dev.
|
|
19
|
+
"@atlaspack/diagnostic": "2.12.1-dev.3398+81c73b3cd",
|
|
20
|
+
"@atlaspack/plugin": "2.12.1-dev.3398+81c73b3cd",
|
|
21
|
+
"@atlaspack/rust": "2.12.1-dev.3398+81c73b3cd",
|
|
22
22
|
"nullthrows": "^1.1.1",
|
|
23
23
|
"posthtml": "^0.16.5",
|
|
24
24
|
"posthtml-parser": "^0.10.1",
|
|
25
25
|
"posthtml-render": "^3.0.0",
|
|
26
26
|
"semver": "^7.5.2"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "81c73b3cdf93adf8b0013be9fed5422579bd5910"
|
|
29
29
|
}
|
package/src/inline.js
CHANGED
|
@@ -73,27 +73,27 @@ export default function extractInlineAssets(
|
|
|
73
73
|
// Inform packager to remove type, since CSS and JS are the defaults.
|
|
74
74
|
delete attrs.type;
|
|
75
75
|
|
|
76
|
-
let
|
|
76
|
+
let parcelKey;
|
|
77
77
|
// allow a script/style tag to declare its key
|
|
78
|
-
if (attrs['data-
|
|
79
|
-
|
|
78
|
+
if (attrs['data-parcel-key']) {
|
|
79
|
+
parcelKey = attrs['data-parcel-key'];
|
|
80
80
|
} else {
|
|
81
|
-
|
|
81
|
+
parcelKey = hashString(`${asset.id}:${key++}`);
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
// insert
|
|
85
|
-
attrs['data-
|
|
84
|
+
// insert parcelId to allow us to retrieve node during packaging
|
|
85
|
+
attrs['data-parcel-key'] = parcelKey;
|
|
86
86
|
asset.setAST(ast); // mark dirty
|
|
87
87
|
|
|
88
88
|
asset.addDependency({
|
|
89
|
-
specifier:
|
|
89
|
+
specifier: parcelKey,
|
|
90
90
|
specifierType: 'esm',
|
|
91
91
|
});
|
|
92
92
|
|
|
93
93
|
parts.push({
|
|
94
94
|
type,
|
|
95
95
|
content: value,
|
|
96
|
-
uniqueKey:
|
|
96
|
+
uniqueKey: parcelKey,
|
|
97
97
|
bundleBehavior: 'inline',
|
|
98
98
|
env,
|
|
99
99
|
meta: {
|
|
@@ -109,9 +109,9 @@ export default function extractInlineAssets(
|
|
|
109
109
|
let attrs = node.attrs;
|
|
110
110
|
let style = attrs?.style;
|
|
111
111
|
if (attrs != null && style != null) {
|
|
112
|
-
let
|
|
112
|
+
let parcelKey = hashString(`${asset.id}:${key++}`);
|
|
113
113
|
attrs.style = asset.addDependency({
|
|
114
|
-
specifier:
|
|
114
|
+
specifier: parcelKey,
|
|
115
115
|
specifierType: 'esm',
|
|
116
116
|
});
|
|
117
117
|
asset.setAST(ast); // mark dirty
|
|
@@ -119,7 +119,7 @@ export default function extractInlineAssets(
|
|
|
119
119
|
parts.push({
|
|
120
120
|
type: 'css',
|
|
121
121
|
content: style,
|
|
122
|
-
uniqueKey:
|
|
122
|
+
uniqueKey: parcelKey,
|
|
123
123
|
bundleBehavior: 'inline',
|
|
124
124
|
meta: {
|
|
125
125
|
type: 'attr',
|