MCPcopy
hub / github.com/QwikDev/qwik / submodulePreloader

Function submodulePreloader

scripts/submodule-preloader.ts:51–72  ·  view source on GitHub ↗
(config: BuildConfig)

Source from the content-addressed store, hash-verified

49 * provides a utility function.
50 */
51export async function submodulePreloader(config: BuildConfig) {
52 await build({
53 build: {
54 emptyOutDir: false,
55 copyPublicDir: false,
56 lib: {
57 entry: join(config.srcQwikDir, 'core/preloader'),
58 formats: ['es', 'cjs'],
59 fileName: (format) => (format === 'es' ? 'preloader.mjs' : 'preloader.cjs'),
60 },
61 rollupOptions: {
62 external: ['@builder.io/qwik/build'],
63 },
64 minify: false, // This is the default, just to be explicit
65 outDir: config.distQwikPkgDir,
66 },
67 plugins: [customTerserPlugin()],
68 });
69
70 const preloaderSize = await fileSize(join(config.distQwikPkgDir, 'preloader.mjs'));
71 console.log(`🐮 preloader:`, preloaderSize);
72}

Callers 1

buildFunction · 0.90

Calls 4

fileSizeFunction · 0.90
joinFunction · 0.85
customTerserPluginFunction · 0.85
buildFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…