代码拉取完成,页面将自动刷新
import commonjs from 'rollup-plugin-commonjs';
import nodeResolve from 'rollup-plugin-node-resolve';
import babel from 'rollup-plugin-babel';
import typescript from 'rollup-plugin-typescript2';
import minify from 'rollup-plugin-babel-minify';
import genHeader from './lib/header';
import css from 'rollup-plugin-css-porter';
// TypeScript because Babel transpiles modules in isolation, therefore no type reexports.
// CommonJS because Babel is not 100 % ESM.
const plugins = {
nodeResolve: nodeResolve({
extensions: ['.ts', '.js', '.json']
}),
typescript: typescript({
tsconfig: 'tsconfig.code.json'
}),
commonjs: commonjs(),
babel: babel({
extensions: ['.ts', '.js'],
runtimeHelpers: true
}),
minify: minify({ comments: false }),
cssRaw: css({
raw: 'dist/vis-network.css',
minified: false
}),
cssMin: css({
raw: false,
minified: 'dist/vis-network.min.css'
})
}
export default [
{
input: 'lib/index-bundle.ts',
output: [{
file: 'dist/vis-network.esm.js',
format: 'esm',
banner: genHeader('network'),
sourcemap: true
}, {
file: 'dist/vis-network.js',
format: 'umd',
exports: 'named',
name: 'vis',
extend: true,
banner: genHeader('network'),
sourcemap: true
}],
plugins: [
plugins.commonjs,
plugins.nodeResolve,
plugins.cssRaw,
plugins.typescript,
plugins.babel
]
},
{
input: 'lib/index-bundle.ts',
output: [{
file: 'dist/vis-network.esm.min.js',
format: 'esm',
banner: genHeader('network'),
sourcemap: true
}, {
file: 'dist/vis-network.min.js',
format: 'umd',
exports: 'named',
name: 'vis',
extend: true,
banner: genHeader('network'),
sourcemap: true
}],
plugins: [
plugins.commonjs,
plugins.nodeResolve,
plugins.cssMin,
plugins.typescript,
plugins.babel,
plugins.minify
]
}
]
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。