Skip to content

Instantly share code, notes, and snippets.

@iamspark1e
Created September 29, 2024 07:20
Show Gist options
  • Select an option

  • Save iamspark1e/ef072bcc22f29f41c6c063df3e9b2a65 to your computer and use it in GitHub Desktop.

Select an option

Save iamspark1e/ef072bcc22f29f41c6c063df3e9b2a65 to your computer and use it in GitHub Desktop.
IE9 compatible rollup config. 兼容IE9的Rollup配置
// npm install --save-dev rollup @rollup/plugin-babel @rollup/plugin-node-resolve @rollup/plugin-commonjs @babel/core @babel/preset-env core-js regenerator-runtime
// npm install --save core-js regenerator-runtime
/**
* IE9 compatible rollup config
*/
import babel from '@rollup/plugin-babel';
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
export default {
input: 'src/index.js',
output: {
file: 'dist/bundle.js',
format: 'iife',
name: 'RichTextEditor'
},
plugins: [
resolve(),
commonjs(),
babel({
babelHelpers: 'bundled',
presets: [
['@babel/preset-env', {
targets: {
ie: '9'
},
useBuiltIns: 'usage',
corejs: 3
}]
],
exclude: 'node_modules/**'
})
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment