workflow(sfc-playground): support import map
This commit is contained in:
@@ -20,7 +20,7 @@ const onChange = debounce((code: string) => {
|
||||
|
||||
const activeCode = ref(store.activeFile.code)
|
||||
const activeMode = computed(
|
||||
() => (store.activeFilename.endsWith('.js') ? 'javascript' : 'htmlmixed')
|
||||
() => (store.activeFilename.endsWith('.vue') ? 'htmlmixed' : 'javascript')
|
||||
)
|
||||
|
||||
watch(
|
||||
|
||||
@@ -45,8 +45,12 @@ function focus({ el }: VNode) {
|
||||
function doneAddFile() {
|
||||
const filename = pendingFilename.value
|
||||
|
||||
if (!filename.endsWith('.vue') && !filename.endsWith('.js')) {
|
||||
store.errors = [`Playground only supports .vue or .js files.`]
|
||||
if (
|
||||
!filename.endsWith('.vue') &&
|
||||
!filename.endsWith('.js') &&
|
||||
filename !== 'import-map.json'
|
||||
) {
|
||||
store.errors = [`Playground only supports *.vue, *.js files or import-map.json.`]
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user