Skip to content

Commit 4d7f440

Browse files
committed
Add ESM version
1 parent 9b2bb47 commit 4d7f440

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"version": "0.2.0",
55
"author": "Vlad Shcherbin <vlad.shcherbin@gmail.com>",
66
"repository": "vladshcherbin/rollup-plugin-delete",
7-
"main": "dist/index.js",
7+
"main": "dist/index.cjs.js",
8+
"module": "dist/index.esm.js",
89
"scripts": {
910
"lint": "eslint src",
1011
"build": "rollup -c",

rollup.config.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@ import babel from 'rollup-plugin-babel'
22

33
export default {
44
input: 'src/index.js',
5-
output: {
6-
file: 'dist/index.js',
7-
format: 'cjs'
8-
},
5+
output: [
6+
{
7+
file: 'dist/index.cjs.js',
8+
format: 'cjs'
9+
},
10+
{
11+
file: 'dist/index.esm.js',
12+
format: 'esm'
13+
}
14+
],
915
plugins: [
1016
babel({
1117
presets: [['@babel/preset-env', { targets: { node: 8 } }]]

0 commit comments

Comments
 (0)