Skip to content

Commit

Permalink
feat: Add support for imba in html scripts (#10679)
Browse files Browse the repository at this point in the history
  • Loading branch information
haikyuu committed Oct 28, 2022
1 parent 675bf07 commit b823fd6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/vite/src/node/optimizer/esbuildDepPlugin.ts
Expand Up @@ -34,6 +34,7 @@ const externalTypes = [
'svelte',
'marko',
'astro',
'imba',
// JSX/TSX may be configured to be compiled differently from how esbuild
// handles it by default, so exclude them as well
'jsx',
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/node/optimizer/scan.ts
Expand Up @@ -29,7 +29,7 @@ type ResolveIdOptions = Parameters<PluginContainer['resolveId']>[2]

const debug = createDebugger('vite:deps')

const htmlTypesRE = /\.(html|vue|svelte|astro)$/
const htmlTypesRE = /\.(html|vue|svelte|astro|imba)$/

// A simple regex to detect import sources. This is only used on
// <script lang="ts"> blocks in vue (setup only) or svelte files, since
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/node/utils.ts
Expand Up @@ -276,7 +276,7 @@ export const isDataUrl = (url: string): boolean => dataUrlRE.test(url)
export const virtualModuleRE = /^virtual-module:.*/
export const virtualModulePrefix = 'virtual-module:'

const knownJsSrcRE = /\.((j|t)sx?|m[jt]s|vue|marko|svelte|astro)($|\?)/
const knownJsSrcRE = /\.((j|t)sx?|m[jt]s|vue|marko|svelte|astro|imba)($|\?)/
export const isJSRequest = (url: string): boolean => {
url = cleanUrl(url)
if (knownJsSrcRE.test(url)) {
Expand Down

0 comments on commit b823fd6

Please sign in to comment.