unplugin/tsup.config.ts
Gengkun 7e4cecbfec
feat: support resolveId for rspack (#388)
* feat: support resolveId for rspack

* fix

* use resolve hook

* use alpha version

* remove skip rspack

* lint code

* Update src/rspack/utils.ts

Co-authored-by: Kevin Deng 三咲智子 <sxzz@sxzz.moe>

* Update docs/guide/index.md

Co-authored-by: Kevin Deng 三咲智子 <sxzz@sxzz.moe>

---------

Co-authored-by: Kevin Deng 三咲智子 <sxzz@sxzz.moe>
2024-07-23 11:30:44 +08:00

38 lines
643 B
TypeScript

import type { Options } from 'tsup'
import { copy } from 'esbuild-plugin-copy'
export const tsup: Options = {
splitting: false,
sourcemap: false,
clean: true,
format: ['cjs', 'esm'],
target: 'node14',
dts: true,
shims: true,
entry: [
'src/index.ts',
'src/webpack/loaders/*',
'src/rspack/loaders/*',
],
external: [
'vite',
'webpack',
'rollup',
'esbuild',
'@farmfe/core',
],
define: {
__DEV__: 'false',
},
esbuildPlugins: [
copy({
assets: [
{
from: ['./src/rspack/virtual.js'],
to: ['./rspack/virtual.js'],
},
],
}),
],
}