加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
rollup.config.js 1.41 KB
一键复制 编辑 原始数据 按行查看 历史
Simon Porritt 提交于 2023-04-02 14:07 . update to single package
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import babel from '@rollup/plugin-babel';
import cleanup from 'rollup-plugin-cleanup';
const extensions = [
'.ts'
];
function ON_WARN(warning, rollupWarn) {
if (warning.code === 'CIRCULAR_DEPENDENCY') {
warning.cycle.forEach((c) => {
if (c.endsWith("index.ts")) {
throw new Error(warning.message)
}
})
console.log(warning.message)
}
}
// package list is stored in package.json
const packages = require("./package.json").packages
// as are names for the packages.
const packageNames = require("./package.json").packageNames
const out = []
out.push({
input: `./ts/index.ts`,
output: [
{
name: "jsPlumb",
file: `dist/browser-ui/js/jsplumb.browser-ui.cjs.js`,
format: 'cjs'
},
{
name: "jsPlumb",
file: `dist/browser-ui/js/jsplumb.browser-ui.es.js`,
format: 'es'
},
{
name: "jsPlumb",
file: `dist/browser-ui/js/jsplumb.browser-ui.umd.js`,
format: 'umd'
}
],
plugins: [
resolve({ extensions }),
commonjs(),
babel({ extensions, include: [`ts/**/*`], babelHelpers:"bundled" }),
cleanup({ extensions:['ts', 'js']})
],
onwarn:ON_WARN
})
export default out
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化