Skip to content

Commit 41415ab

Browse files
committed
feat(tabs): Publish also as ES2015 modules
1 parent 9a3a5da commit 41415ab

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

.babelrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
'use strict';
22

33
const target = process.env.BABEL_TARGET;
4-
const modules = target === 'rollup' ? false : 'commonjs';
4+
const output = process.env.BABEL_OUTPUT;
5+
const modules = target === 'rollup' || output === 'esm' ? false : 'commonjs';
56

67
const options = {
78
presets: [['env', { loose: true, modules }], 'react'],

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
examples
33
lib
44
dist
5+
esm

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ node_modules/
33
npm-debug.log
44
lib/
55
dist/
6+
esm/

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
"version": "2.0.0",
44
"description": "React tabs component",
55
"main": "lib/index.js",
6+
"module": "esm/index.js",
67
"scripts": {
78
"clean:commonjs": "rimraf lib",
89
"clean:umd": "rimraf dist",
910
"create-github-release": "conventional-github-releaser -p angular",
1011
"build:commonjs": "babel src/ --out-dir lib/ --ignore **/__tests__,**/__mocks__",
12+
"build:esm": "BABEL_OUTPUT=esm babel src/ --out-dir esm/ --ignore **/__tests__,**/__mocks__",
1113
"build:umd": "BABEL_TARGET=rollup yarn rollup -c",
1214
"build": "npm-run-all clean:* --parallel build:*",
1315
"format": "eslint src --fix",
@@ -30,6 +32,7 @@
3032
},
3133
"files": [
3234
"dist",
35+
"esm",
3336
"lib",
3437
"style"
3538
],

0 commit comments

Comments
 (0)