@lightningjs/vite-plugin-import-chunk-url
v0.3.1
Published
This plugin allows you to declare that a JavaScript/TypeScript file be bundled into a seperate chunk while getting the relative URL to that chunk file. The chunk can then be imported dynamically or run via a worker.
Downloads
318
Keywords
Readme
vite-plugin-import-chunk-url
This plugin allows you to declare that a JavaScript/TypeScript file be bundled into a seperate chunk while getting the relative URL to that chunk file. The chunk can then be imported dynamically or run via a worker.
Usage
vite.config.ts
import { importChunkUrl } from 'vite-plugin-import-chunk-url';
export default defineConfig(({ command, mode, ssrBuild }) => {
return {
plugins: [
importChunkUrl(),
],
build: {
minify: false,
sourcemap: true,
}
};
});
app.ts
import customModuleBundleUrl from './CustomCodeModule.js?importChunkUrl';
import(customModuleBundleUrl).then(/*..*/);