Skip to content

Commit a78c902

Browse files
committed
feat(inspect): update json inspect cases
1 parent 5ae8bec commit a78c902

File tree

5 files changed

+20
-14
lines changed

5 files changed

+20
-14
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"usingComponents": {
3+
"list": "../components/list"
4+
}
5+
}

inspect-extension/components/script-json/demo01/index.mpx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ createPage({})
1212
{
1313
"usingComponents": {
1414
"list": "../components/list"
15-
}
15+
}
1616
}
1717
</script>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const wxConfig = { component: true, usingComponents: {} }
2+
const aliConfig = { component: true, usingComponents: {} }
3+
let finalConfig = null
4+
if (__mpx_mode__ === 'ali') {
5+
finalConfig = aliConfig1
6+
} else {
7+
finalConfig = wxConfig
8+
}
9+
module.exports = finalConfig

inspect-extension/components/script-json/json-js/index.mpx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,13 @@ defineProps<{
1111
}>()
1212
</script>
1313

14-
<style lang="css">
15-
.list {
16-
17-
}
14+
<style lang="stylus">
15+
.list
16+
color red
1817
</style>
1918

2019
<script name="json">
21-
const wxConfig = { component: true, usingComponents: {} };
20+
const wxConfig: any = { component: true, usingComponents: {} };
2221
const aliConfig = { component: true, usingComponents: {} };
2322
let finalConfig = null;
2423
if (__mpx_mode__ === "ali") {
@@ -27,4 +26,4 @@ defineProps<{
2726
finalConfig = wxConfig;
2827
}
2928
module.exports = finalConfig;
30-
</script>
29+
</script>

packages/language-core/src/languagePlugin.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,6 @@ export function createMpxLanguagePlugin<T>(
135135
? ts.ScriptKind.TSX
136136
: ts.ScriptKind.TS,
137137
}
138-
} else if (/json_(js|ts)/.test(code.id)) {
139-
const lang = code.id.slice('json_'.length)
140-
return {
141-
code,
142-
extension: '.' + lang,
143-
scriptKind: lang === 'js' ? ts.ScriptKind.JS : ts.ScriptKind.JSON,
144-
}
145138
}
146139
}
147140
},

0 commit comments

Comments
 (0)