revert rollup.config: manualChunks not helpful

pull/3386/head
Yuxuan Zhang 2 years ago
parent f196fb6d17
commit 8c429b4473
No known key found for this signature in database
GPG Key ID: 6910B04F3351EF7D

@ -46,26 +46,12 @@ const plugins = [
json()
]
const node_root = r('src/node/')
const esmBuild: RollupOptions = {
input: [r('src/node/index.ts'), r('src/node/cli.ts')],
output: {
format: 'esm',
entryFileNames: `[name].js`,
chunkFileNames(chunk) {
return `${chunk.name}-[hash].js`
},
manualChunks(id) {
// Chunk each worker into a separate file
if (!id.startsWith(node_root)) return
id = id.slice(node_root.length).replace(/^\//, '')
const match = /^.*\-worker(?=(\.(js|ts))?$)/i.exec(id)
if (match) {
const [name] = match
return name
}
},
chunkFileNames: 'serve-[hash].js',
dir: r('dist/node'),
sourcemap: DEV
},

Loading…
Cancel
Save