marko 6.0.150 → 6.0.152
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/dist/translator/index.js +21 -14
- package/package.json +2 -2
package/dist/translator/index.js
CHANGED
|
@@ -11692,12 +11692,6 @@ var style_default = {
|
|
|
11692
11692
|
);
|
|
11693
11693
|
}
|
|
11694
11694
|
}
|
|
11695
|
-
if (node.body.body.length > 1) {
|
|
11696
|
-
throw tag.hub.buildError(
|
|
11697
|
-
node.name,
|
|
11698
|
-
"The [`<style>` tag](https://markojs.com/docs/reference/core-tag#style) currently only supports static content." + htmlStyleTagAlternateMsg
|
|
11699
|
-
);
|
|
11700
|
-
}
|
|
11701
11695
|
},
|
|
11702
11696
|
translate(tag) {
|
|
11703
11697
|
const {
|
|
@@ -11709,16 +11703,29 @@ var style_default = {
|
|
|
11709
11703
|
if (node.var && !/\.module\./.test(ext)) {
|
|
11710
11704
|
ext = ".module" + ext;
|
|
11711
11705
|
}
|
|
11712
|
-
const markoText = node.body.body[0];
|
|
11713
11706
|
const { resolveVirtualDependency } = getMarkoOpts();
|
|
11714
|
-
const
|
|
11715
|
-
|
|
11716
|
-
let code =
|
|
11707
|
+
const createMap = !!(resolveVirtualDependency && sourceMaps);
|
|
11708
|
+
let magicString;
|
|
11709
|
+
let code = "";
|
|
11710
|
+
let last = 0;
|
|
11717
11711
|
let map;
|
|
11718
|
-
|
|
11719
|
-
|
|
11720
|
-
|
|
11721
|
-
|
|
11712
|
+
for (const child of node.body.body) {
|
|
11713
|
+
code += child.value;
|
|
11714
|
+
if (createMap) {
|
|
11715
|
+
const start = (0, import_babel_utils44.getStart)(file, child);
|
|
11716
|
+
if (start !== null) {
|
|
11717
|
+
magicString ||= new import_magic_string.default(file.code, { filename });
|
|
11718
|
+
if (start > last) {
|
|
11719
|
+
magicString.remove(last, start);
|
|
11720
|
+
}
|
|
11721
|
+
last = (0, import_babel_utils44.getEnd)(file, child);
|
|
11722
|
+
}
|
|
11723
|
+
}
|
|
11724
|
+
}
|
|
11725
|
+
if (magicString) {
|
|
11726
|
+
if (file.code.length > last) {
|
|
11727
|
+
magicString.remove(last, file.code.length);
|
|
11728
|
+
}
|
|
11722
11729
|
map = magicString.generateMap({
|
|
11723
11730
|
source: filename,
|
|
11724
11731
|
includeContent: true
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "marko",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.152",
|
|
4
4
|
"description": "Optimized runtime for Marko templates.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"build": "node -r ~ts ./scripts/bundle.ts"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@marko/compiler": "^5.39.
|
|
51
|
+
"@marko/compiler": "^5.39.58",
|
|
52
52
|
"csstype": "^3.2.3",
|
|
53
53
|
"magic-string": "^0.30.21"
|
|
54
54
|
},
|