1 Star 0 Fork 23

摩诘无花/nutui-react

forked from 京东零售/nutui-react 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
rollup.config.es.js 1.53 KB
一键复制 编辑 原始数据 按行查看 历史
import commonjs from '@rollup/plugin-commonjs'
import typescript from '@rollup/plugin-typescript'
import { getBabelOutputPlugin } from '@rollup/plugin-babel'
const path = require('path')
const config = require('./src/config.json')
const entries = {
'nutui-react.es': path.join(__dirname, `./src/packages/nutui.react.build.ts`),
}
const outputEntries = {}
config.nav.map((item) => {
item.packages.forEach((element) => {
const { name, show, type, exportEmpty } = element
if (show || exportEmpty) {
outputEntries[`./${name.toLowerCase()}`] = `./${name}`
entries[name] = path.join(
__dirname,
`./src/packages/${name.toLowerCase()}/index.ts`
)
}
})
})
export default {
input: entries,
external: (id, parent) =>
/^react/.test(id) ||
/^react-dom/.test(id) ||
/^classnames/.test(id) ||
/^@use-gesture/.test(id) ||
/^@react-spring/.test(id) ||
/^@bem-react/.test(id) ||
(/^@\/packages\/\w+$/.test(id) && !!parent),
output: {
format: 'esm',
dir: './dist/esm',
name: '[entryName].js',
paths: (id) => {
return /@\/packages/.test(id)
? `${outputEntries[id.replace('@/packages/', './')]}.js`
: id
},
},
plugins: [
commonjs(),
typescript(),
getBabelOutputPlugin({
presets: ['@babel/preset-env'],
plugins: [
'@babel/plugin-transform-runtime',
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-syntax-dynamic-import',
],
}),
],
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
TypeScript
1
https://gitee.com/liuyuanjiang/nutui-react.git
[email protected]:liuyuanjiang/nutui-react.git
liuyuanjiang
nutui-react
nutui-react
main

搜索帮助