use standard polyfills (only tested with esm)

This commit is contained in:
jfh
2020-08-09 18:33:17 +02:00
parent ff98330ddf
commit 842f59b6c1
21 changed files with 57243 additions and 3282 deletions

View File

@@ -3,24 +3,32 @@ 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'
file: 'dist/editor/index.js',
inlineDynamicImports: true,
sourcemap: true
// dir: 'dist/editor'
},
{
format: 'iife',
file: 'dist/editor/index-iife.js'
file: 'dist/editor/index-iife.js',
inlineDynamicImports: true
},
{
format: 'umd',
file: 'dist/editor/index-umd.js'
file: 'dist/editor/index-umd.js',
inlineDynamicImports: true
}
],
plugins: [
@@ -59,8 +67,13 @@ const config = {
{src: 'src/editor/svgedit.css', dest: 'dist/editor'}
]
}),
nodeResolve(),
babel({babelHelpers: 'bundled'})
commonjs(),
babel({babelHelpers: 'bundled'}),
nodePolyfills(),
nodeResolve({
browser: true,
preferBuiltins: true
})
]
};