diff --git a/eslint.config.js b/eslint.config.js index 32196fc1764b..b72a134ebcc0 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -274,6 +274,7 @@ export default [ { files: [ 'site/src/assets/application.js', + 'site/src/assets/bootstrap.bundle.js', 'site/src/assets/partials/*.js', 'site/src/assets/search.js', 'site/src/assets/snippets.js', diff --git a/site/src/assets/bootstrap.bundle.js b/site/src/assets/bootstrap.bundle.js new file mode 100644 index 000000000000..f21f382b7e0b --- /dev/null +++ b/site/src/assets/bootstrap.bundle.js @@ -0,0 +1,3 @@ +import * as bootstrapBundle from '../../../dist/js/bootstrap.bundle.js' + +Object.keys(bootstrapBundle) diff --git a/site/src/components/Scripts.astro b/site/src/components/Scripts.astro index 3ce53e2c4fec..a4f3064b94d0 100644 --- a/site/src/components/Scripts.astro +++ b/site/src/components/Scripts.astro @@ -1,4 +1,5 @@ --- +import { getVersionedBsJsProps } from '@libs/bootstrap' import type { Layout } from '@libs/layout' import DocsScripts from './DocsScripts.astro' @@ -9,6 +10,8 @@ interface Props { const { layout } = Astro.props --- + + diff --git a/site/src/libs/bootstrap.ts b/site/src/libs/bootstrap.ts index 3b033895480a..c07e5962e16f 100644 --- a/site/src/libs/bootstrap.ts +++ b/site/src/libs/bootstrap.ts @@ -26,6 +26,13 @@ export function getVersionedBsCssProps(direction: 'rtl' | undefined) { export function getVersionedBsJsProps() { let bsJsScriptSrc = '/dist/js/bootstrap.bundle' + if (import.meta.env.DEV) { + return { + type: 'module', + src: '/src/assets/bootstrap.bundle.js' + } satisfies HTMLAttributes<'script'> + } + if (import.meta.env.PROD) { bsJsScriptSrc = `${bsJsScriptSrc}.min` }