0.3.1 • Published 24 days ago

@lightningjs/vite-plugin-import-chunk-url v0.3.1

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
24 days ago

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(/*..*/);
0.3.1

24 days ago

0.3.0

8 months ago

0.0.1

8 months ago