/* eslint-env node */ import rimraf from 'rimraf'; import babel from '@rollup/plugin-babel'; import copy from 'rollup-plugin-copy'; import {nodeResolve} from '@rollup/plugin-node-resolve'; import commonjs from '@rollup/plugin-commonjs'; import nodePolyfills from 'rollup-plugin-node-polyfills'; // eslint-disable-next-line no-console rimraf('./dist', () => console.info('recreating dist')); const config = { input: 'src/editor/index.js', preserveEntrySignatures: false, output: [ { format: 'es', file: 'dist/editor/index.js', inlineDynamicImports: true, sourcemap: true // dir: 'dist/editor' }, { format: 'iife', file: 'dist/editor/index-iife.js', inlineDynamicImports: true }, { format: 'umd', file: 'dist/editor/index-umd.js', inlineDynamicImports: true } ], plugins: [ copy({ targets: [ { src: 'src/editor/index.html', dest: 'dist/editor' }, { src: 'src/editor/index.html', dest: 'dist/editor', rename: 'index-iife.html', transform: (contents) => contents.toString() .replace('