Minify worker source
This commit is contained in:
@@ -29,8 +29,14 @@ async function build(input, {minify = true} = {}) {
|
||||
}
|
||||
]
|
||||
]
|
||||
}),
|
||||
{
|
||||
})
|
||||
];
|
||||
|
||||
if (minify) {
|
||||
plugins.push(terser());
|
||||
}
|
||||
|
||||
plugins.push({
|
||||
name: 'serialize worker and export create function',
|
||||
renderChunk(code) {
|
||||
return `
|
||||
@@ -42,12 +48,7 @@ async function build(input, {minify = true} = {}) {
|
||||
}
|
||||
`;
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
if (minify) {
|
||||
plugins.push(terser());
|
||||
}
|
||||
});
|
||||
|
||||
const bundle = await rollup.rollup({input, plugins});
|
||||
const {output} = await bundle.generate({format: 'es'});
|
||||
|
||||
Reference in New Issue
Block a user