Created
September 29, 2024 07:20
-
-
Save iamspark1e/ef072bcc22f29f41c6c063df3e9b2a65 to your computer and use it in GitHub Desktop.
IE9 compatible rollup config. 兼容IE9的Rollup配置
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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