Skip to content

Commit 0a406d0

Browse files
committed
chore(package): support for jsnext:main
1 parent af12695 commit 0a406d0

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

.babelrc

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
{
22
"presets": [
3-
"es2015",
3+
"./build/preset-es2015",
44
"react",
55
"stage-1"
66
],
77
"plugins": [
8-
"lodash",
98
"transform-react-handled-props",
109
["transform-react-remove-prop-types", {
1110
"mode": "wrap"

build/preset-es2015.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const options = process.env.BABEL_ENV === 'es' ? { modules: false } : {}
2+
const plugins = process.env.BABEL_ENV === 'es' ? [] : ['lodash']
3+
4+
module.exports = {
5+
presets: [
6+
['es2015', options]
7+
],
8+
plugins,
9+
}

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,19 @@
33
"version": "0.64.3",
44
"description": "The official Semantic-UI-React integration.",
55
"main": "dist/commonjs/index.js",
6+
"jsnext:main": "dist/es/index.js",
67
"files": [
78
"src",
89
"dist",
910
"index.d.ts"
1011
],
1112
"scripts": {
1213
"docs": "gulp docs",
13-
"build": "npm run build:commonjs && npm run build:umd && npm run build:docs",
14+
"build": "npm run build:commonjs && npm run build:es && npm run build:umd && npm run build:docs",
1415
"prebuild:commonjs": "rimraf dist/commonjs",
1516
"build:commonjs": "babel src -d dist/commonjs && npm run tsd",
17+
"prebuild:es": "rimraf dist/es",
18+
"build:es": "cross-env BABEL_ENV=es babel src -d dist/es",
1619
"prebuild:docs": "npm run build:docs-toc",
1720
"build:dll": "gulp dll",
1821
"build:docs": "gulp build:docs",

0 commit comments

Comments
 (0)