You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
672 B
33 lines
672 B
import { build } from "tsdown"
|
|
|
|
const argvs = process.argv.slice(2)
|
|
const command = argvs[0]
|
|
// const entryPath = argvs[1]
|
|
|
|
if (command === 'dev') {
|
|
build({
|
|
watch: true,
|
|
// entry: entryPath ? [entryPath] : undefined,
|
|
sourcemap: false,
|
|
dts: false,
|
|
alias: {
|
|
"@": "./src"
|
|
},
|
|
outExtensions: () => {
|
|
return { js: '.js', dts: '.d.ts' }
|
|
}
|
|
})
|
|
} else {
|
|
build({
|
|
// entry: entryPath ? [entryPath] : undefined,
|
|
sourcemap: false,
|
|
dts: false,
|
|
alias: {
|
|
"@": "./src"
|
|
},
|
|
format: ['esm', 'cjs'],
|
|
outExtensions: () => {
|
|
return { js: '.js', dts: '.d.ts' }
|
|
}
|
|
})
|
|
}
|
|
|