-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use AppConfig to define CompilerOptions (#37)
- use AppConfig to add RuntimeCompilerOptions at runtime - use AppConfig to add RuntimeCompilerOptions at build time - update README
- Loading branch information
1 parent
b690367
commit e39b6be
Showing
10 changed files
with
358 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
export default defineAppConfig({ | ||
vue: { | ||
compilerOptions: { | ||
isCustomElement: (tag) => { | ||
return ['math', | ||
'maction', | ||
'maligngroup', | ||
'malignmark', | ||
'menclose', | ||
'merror', | ||
'mfenced', | ||
'mfrac', | ||
'mi', | ||
'mlongdiv', | ||
'mmultiscripts', | ||
'mn', | ||
'mo', | ||
'mover', | ||
'mpadded', | ||
'mphantom', | ||
'mroot', | ||
'mrow', | ||
'ms', | ||
'mscarries', | ||
'mscarry', | ||
'mscarries', | ||
'msgroup', | ||
'mstack', | ||
'mlongdiv', | ||
'msline', | ||
'mstack', | ||
'mspace', | ||
'msqrt', | ||
'msrow', | ||
'mstack', | ||
'mstack', | ||
'mstyle', | ||
'msub', | ||
'msup', | ||
'msubsup', | ||
'mtable', | ||
'mtd', | ||
'mtext', | ||
'mtr', | ||
'munder', | ||
'munderover', | ||
'semantics', | ||
'math', | ||
'mi', | ||
'mn', | ||
'mo', | ||
'ms', | ||
'mspace', | ||
'mtext', | ||
'menclose', | ||
'merror', | ||
'mfenced', | ||
'mfrac', | ||
'mpadded', | ||
'mphantom', | ||
'mroot', | ||
'mrow', | ||
'msqrt', | ||
'mstyle', | ||
'mmultiscripts', | ||
'mover', | ||
'mprescripts', | ||
'msub', | ||
'msubsup', | ||
'msup', | ||
'munder', | ||
'munderover', | ||
'none', | ||
'maligngroup', | ||
'malignmark', | ||
'mtable', | ||
'mtd', | ||
'mtr', | ||
'mlongdiv', | ||
'mscarries', | ||
'mscarry', | ||
'msgroup', | ||
'msline', | ||
'msrow', | ||
'mstack', | ||
'maction', | ||
'semantics', | ||
'annotation', | ||
'annotation-xml' | ||
].includes(tag) | ||
} | ||
} | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { defineNuxtPlugin, useAppConfig } from '#imports' | ||
|
||
export default defineNuxtPlugin((nuxtApp) => { | ||
const appConfig = useAppConfig() | ||
nuxtApp.vueApp.config.compilerOptions.isCustomElement = appConfig.vue?.compilerOptions?.isCustomElement | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
import { RuntimeCompilerOptions } from 'vue' | ||
|
||
declare module '@nuxt/schema' { | ||
interface AppConfig { | ||
vue?: { | ||
compilerOptions?: RuntimeCompilerOptions | ||
} | ||
} | ||
|
||
interface AppConfigInput { | ||
vue?: { | ||
compilerOptions?: RuntimeCompilerOptions | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
export default defineAppConfig({ | ||
vue: { | ||
compilerOptions: { | ||
isCustomElement: (tag) => { | ||
return [ | ||
'math', | ||
'maction', | ||
'maligngroup', | ||
'malignmark', | ||
'menclose', | ||
'merror', | ||
'mfenced', | ||
'mfrac', | ||
'mi', | ||
'mlongdiv', | ||
'mmultiscripts', | ||
'mn', | ||
'mo', | ||
'mover', | ||
'mpadded', | ||
'mphantom', | ||
'mroot', | ||
'mrow', | ||
'ms', | ||
'mscarries', | ||
'mscarry', | ||
'mscarries', | ||
'msgroup', | ||
'mstack', | ||
'mlongdiv', | ||
'msline', | ||
'mstack', | ||
'mspace', | ||
'msqrt', | ||
'msrow', | ||
'mstack', | ||
'mstack', | ||
'mstyle', | ||
'msub', | ||
'msup', | ||
'msubsup', | ||
'mtable', | ||
'mtd', | ||
'mtext', | ||
'mtr', | ||
'munder', | ||
'munderover', | ||
'semantics', | ||
'math', | ||
'mi', | ||
'mn', | ||
'mo', | ||
'ms', | ||
'mspace', | ||
'mtext', | ||
'menclose', | ||
'merror', | ||
'mfenced', | ||
'mfrac', | ||
'mpadded', | ||
'mphantom', | ||
'mroot', | ||
'mrow', | ||
'msqrt', | ||
'mstyle', | ||
'mmultiscripts', | ||
'mover', | ||
'mprescripts', | ||
'msub', | ||
'msubsup', | ||
'msup', | ||
'munder', | ||
'munderover', | ||
'none', | ||
'maligngroup', | ||
'malignmark', | ||
'mtable', | ||
'mtd', | ||
'mtr', | ||
'mlongdiv', | ||
'mscarries', | ||
'mscarry', | ||
'msgroup', | ||
'msline', | ||
'msrow', | ||
'mstack', | ||
'maction', | ||
'semantics', | ||
'annotation', | ||
'annotation-xml' | ||
].includes(tag) | ||
} | ||
} | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.