代码拉取完成,页面将自动刷新
import alias from '@rollup/plugin-alias';
import babel from '@rollup/plugin-babel';
import commonjs from '@rollup/plugin-commonjs';
import copy from 'rollup-plugin-copy';
import json from '@rollup/plugin-json';
import reactSvg from 'rollup-plugin-react-svg';
import resolve from '@rollup/plugin-node-resolve';
import pkg from './package.json';
const nonbundledDependencies = Object.keys({ ...pkg.dependencies, ...pkg.peerDependencies });
const nonExternalDependencies = [ 'preact-markup' ];
export default [
{
input: 'src/index.js',
output: [
{
sourcemap: true,
format: 'umd',
file: pkg['umd:main'],
name: 'BpmnJSPropertiesPanel'
}
],
plugins: pgl()
},
{
input: 'src/index.js',
output: [
{
sourcemap: true,
format: 'commonjs',
file: pkg.main
},
{
sourcemap: true,
format: 'esm',
file: pkg.module
}
],
external: externalDependencies(),
plugins: pgl([
copy({
targets: [
{ src: 'node_modules/@bpmn-io/properties-panel/assets/**/*.css', dest: 'dist/assets' },
{ src: 'assets/*.css', dest: 'dist/assets' }
]
})
])
}
];
function pgl(plugins = []) {
return [
...plugins,
alias({
entries: [
{ find: 'react', replacement: '@bpmn-io/properties-panel/preact/compat' },
{ find: 'preact', replacement: '@bpmn-io/properties-panel/preact' }
]
}),
reactSvg(),
babel({
babelHelpers: 'bundled',
plugins: [
[ '@babel/plugin-transform-react-jsx', {
'importSource': '@bpmn-io/properties-panel/preact',
'runtime': 'automatic'
} ]
]
}),
json(),
resolve({
mainFields: [
'browser',
'module',
'main'
]
}),
commonjs()
];
}
function externalDependencies() {
return id => {
return nonbundledDependencies.find(dep => id.startsWith(dep)) &&
!nonExternalDependencies.find(dep => id.startsWith(dep));
};
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。