unbuild
unbuild copied to clipboard
minify support
Maybe we can support min flag for unbuild and unify tooling?
see https://github.com/nuxt-community/color-mode-module/pull/118#discussion_r796728630
Is there any workaround?
@seanghay I found this config seemed to work:
rollup: {
esbuild: {
minify: true,
},
},
@pi0 I also have this problem, and my unbuild config this:
import { defineBuildConfig } from "unbuild";
export default defineBuildConfig({
entries: ["./index"],
declaration: true,
clean: true,
failOnWarn: false,
rollup: {
emitCJS: true,
esbuild: {
minify: true
}
}
});
But after pnpm build
, I get this error:
Error building E:/project/changan-incall/packages/microApp: Error: Transform failed with 1 error:
<stdin>:1:10: ERROR: Expected ";" but found "EnterMicroAppParams"
Error: Transform failed with 1 error:
<stdin>:1:10: ERROR: Expected ";" but found "EnterMicroAppParams"
at failureErrorWithLog (E:\project\changan-incall\node_modules\.pnpm\[email protected]\node_modules\esbuild\lib\main.js:1624:15)
at E:\project\changan-incall\node_modules\.pnpm\[email protected]\node_modules\esbuild\lib\main.js:1413:29
at E:\project\changan-incall\node_modules\.pnpm\[email protected]\node_modules\esbuild\lib\main.js:678:9
at handleIncomingPacket (E:\project\changan-incall\node_modules\.pnpm\[email protected]\node_modules\esbuild\lib\main.js:775:9)
at Socket.readFromStdout (E:\project\changan-incall\node_modules\.pnpm\[email protected]\node_modules\esbuild\lib\main.js:644:7)
at Socket.emit (node:events:526:28)
at addChunk (node:internal/streams/readable:315:12)
at readableAddChunk (node:internal/streams/readable:289:9)
at Socket.Readable.push (node:internal/streams/readable:228:10)
at Pipe.onStreamRead (node:internal/stream_base_commons:190:23) {
errors: [
{
detail: undefined,
id: '',
location: [Object],
notes: [],
pluginName: '',
text: 'Expected ";" but found "EnterMicroAppParams"'
}
],
warnings: [],
code: 'PLUGIN_ERROR',
plugin: 'esbuild',
hook: 'renderChunk'
}
How Can I resolve this ?
But after
pnpm build
, I get this error:
I have encountered this error as well. It may be caused by esbuild trying to minify a ts/d.ts file.