@jsenv/ast 6.6.7 → 6.6.9
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/package.json +4 -4
- package/src/html/html_node.js +7 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsenv/ast",
|
|
3
|
-
"version": "6.6.
|
|
3
|
+
"version": "6.6.9",
|
|
4
4
|
"description": "Parse and transform HTML, CSS and JS",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
],
|
|
31
31
|
"sideEffects": false,
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@babel/parser": "7.
|
|
34
|
-
"@jsenv/humanize": "1.
|
|
35
|
-
"@jsenv/urls": "2.7.
|
|
33
|
+
"@babel/parser": "7.27.0",
|
|
34
|
+
"@jsenv/humanize": "1.5.0",
|
|
35
|
+
"@jsenv/urls": "2.7.2",
|
|
36
36
|
"acorn": "8.14.1",
|
|
37
37
|
"acorn-import-attributes": "1.9.5",
|
|
38
38
|
"acorn-walk": "8.3.4",
|
package/src/html/html_node.js
CHANGED
|
@@ -52,7 +52,7 @@ export const injectHtmlNode = (htmlAst, node, jsenvPluginName = "jsenv") => {
|
|
|
52
52
|
|
|
53
53
|
export const injectJsenvScript = (
|
|
54
54
|
htmlAst,
|
|
55
|
-
{ type, src, content, initCall, pluginName = "jsenv" },
|
|
55
|
+
{ type, src, content, initCall, pluginName = "jsenv", ...attributes },
|
|
56
56
|
) => {
|
|
57
57
|
const jsenvScriptsNode = getJsenvScriptsNode(htmlAst);
|
|
58
58
|
if (type === "module") {
|
|
@@ -63,6 +63,7 @@ export const injectJsenvScript = (
|
|
|
63
63
|
"tagName": "script",
|
|
64
64
|
"type": "module",
|
|
65
65
|
"jsenv-injected-by": pluginName,
|
|
66
|
+
...attributes,
|
|
66
67
|
"children": `import { ${initCall.callee} } from ${JSON.stringify(src)};
|
|
67
68
|
|
|
68
69
|
${initCall.callee}({
|
|
@@ -77,6 +78,7 @@ ${initCall.callee}({
|
|
|
77
78
|
"type": "module",
|
|
78
79
|
src,
|
|
79
80
|
"jsenv-injected-by": pluginName,
|
|
81
|
+
...attributes,
|
|
80
82
|
});
|
|
81
83
|
insertHtmlNodeInside(remoteScriptNode, jsenvScriptsNode);
|
|
82
84
|
return;
|
|
@@ -86,6 +88,7 @@ ${initCall.callee}({
|
|
|
86
88
|
"type": "module",
|
|
87
89
|
"jsenv-injected-by": pluginName,
|
|
88
90
|
"children": content,
|
|
91
|
+
...attributes,
|
|
89
92
|
});
|
|
90
93
|
insertHtmlNodeInside(jsenvScriptsNode, inlineScriptNode);
|
|
91
94
|
return;
|
|
@@ -95,6 +98,7 @@ ${initCall.callee}({
|
|
|
95
98
|
"tagName": "script",
|
|
96
99
|
src,
|
|
97
100
|
"jsenv-injected-by": pluginName,
|
|
101
|
+
...attributes,
|
|
98
102
|
});
|
|
99
103
|
insertHtmlNodeInside(remoteScriptNode, jsenvScriptsNode);
|
|
100
104
|
if (initCall) {
|
|
@@ -105,6 +109,7 @@ ${initCall.callee}({
|
|
|
105
109
|
"children": `${initCall.callee}({
|
|
106
110
|
${paramsSource}
|
|
107
111
|
});`,
|
|
112
|
+
...attributes,
|
|
108
113
|
});
|
|
109
114
|
insertHtmlNodeInside(inlineScriptNode, jsenvScriptsNode);
|
|
110
115
|
}
|
|
@@ -114,6 +119,7 @@ ${initCall.callee}({
|
|
|
114
119
|
"tagName": "script",
|
|
115
120
|
"jsenv-injected-by": pluginName,
|
|
116
121
|
"children": content,
|
|
122
|
+
...attributes,
|
|
117
123
|
});
|
|
118
124
|
insertHtmlNodeInside(inlineScriptNode, jsenvScriptsNode);
|
|
119
125
|
};
|