0.1.3 • Published 11 months ago
rollup-plugin-inject-umd-deps v0.1.3
rollup-plugin-inject-umd-deps
// vite.config.js
import injectUmdDeps from'rollup-plugin-inject-umd-deps'
export default {
plugins: [
// 默认注入文件名称包含 '.umd.'的chunk文件中
injectUmdDeps({
// 在生成的umd文件中额外导入一个依赖项
anotherModule: 'another-module',
})
// 在自定义的chunk文件中注入
injectUmdDeps({
// 在生成的umd文件中额外导入一个依赖项
anotherModule: 'another-module',
}, {
test: filename => filename === 'index.js'
})
]
}