vite
vite copied to clipboard
多入口打包时,怎样根据input去自定义输出模块类型。
Clear and concise description of the problem
input: { index: 'index.html', // index background: 'chrome-settings/background.ts', // background 想要 umd iife 类型 contentScript: 'chrome-settings/contentScript.ts', // contentScript 想要 esm 类型 options: resolve(__dirname, 'options/index.html'), // options }, output: { chunkFileNames: '[name].[hash].js', assetFileNames: '[name].[hash].[ext]', entryFileNames: '[name].js', dir: 'dist', },
background 想要 umd iife 类型 contentScript 想要 esm 类型
如何进行设置
Suggested solution
有解决方案么,各位大佬。
Alternative
No response
Additional context
No response
Validations
- [X] Follow our Code of Conduct
- [X] Read the Contributing Guidelines.
- [X] Read the docs.
- [X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
I am facing same problem also
I am facing same problem also