2022-08-14 13:01:51 +00:00
|
|
|
/* eslint-env node */
|
|
|
|
// This rollup script is run by the command:
|
|
|
|
// 'npm run build'
|
|
|
|
|
2023-05-28 07:36:05 +00:00
|
|
|
import { rimraf } from 'rimraf'
|
2022-08-14 13:01:51 +00:00
|
|
|
import babel from '@rollup/plugin-babel'
|
|
|
|
import { nodeResolve } from '@rollup/plugin-node-resolve'
|
|
|
|
import commonjs from '@rollup/plugin-commonjs'
|
|
|
|
// import progress from 'rollup-plugin-progress';
|
|
|
|
import filesize from 'rollup-plugin-filesize'
|
|
|
|
|
|
|
|
// remove existing distribution
|
2023-03-30 23:57:06 +00:00
|
|
|
await rimraf('./dist')
|
|
|
|
console.info('recreating dist')
|
2022-08-14 13:01:51 +00:00
|
|
|
|
|
|
|
// config for svgedit core module
|
|
|
|
const config = [{
|
|
|
|
input: ['./svgcanvas.js'],
|
|
|
|
output: [
|
|
|
|
{
|
|
|
|
format: 'es',
|
|
|
|
inlineDynamicImports: true,
|
|
|
|
sourcemap: true,
|
|
|
|
file: 'dist/svgcanvas.js'
|
|
|
|
}
|
|
|
|
],
|
|
|
|
plugins: [
|
|
|
|
nodeResolve({
|
|
|
|
browser: true,
|
|
|
|
preferBuiltins: false
|
|
|
|
}),
|
|
|
|
commonjs(),
|
|
|
|
babel({ babelHelpers: 'bundled', exclude: [/\/core-js\//] }), // exclude core-js to avoid circular dependencies.
|
|
|
|
filesize()
|
|
|
|
]
|
|
|
|
}]
|
|
|
|
export default config
|