Skip to content

Commit f8fac2a

Browse files
committed
feat: add jsnext:main
1 parent 582cc5e commit f8fac2a

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
node_modules/
55
npm-debug.log
66

7+
lib/
78
test/
89

910
.travis.yml

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "koa-proxies",
33
"description": "Http Proxy Middleware for Koa@2.x/next",
44
"main": "dist/koa-proxies.js",
5+
"jsnext:main": "dist/koa-proxies.es2015.js",
56
"scripts": {
67
"build": "rimraf dist/** && NODE_ENV=production node rollup.config.js",
78
"build:dev": "node rollup.config.js",

rollup.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,11 @@ rollup.rollup({
2424
format: 'cjs',
2525
dest: pkg['main']
2626
})
27+
28+
if (process.env.NODE_ENV === 'production') {
29+
bundle.write({
30+
dest: pkg['jsnext:main'],
31+
format: 'es'
32+
})
33+
}
2734
})

0 commit comments

Comments
 (0)