Skip to content

Commit faeba21

Browse files
committed
fix stuff
1 parent 63b44c1 commit faeba21

File tree

3 files changed

+31
-13
lines changed

3 files changed

+31
-13
lines changed

.babelrc

-12
This file was deleted.

.babelrc.js

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
const env = process.env.NODE_ENV;
2+
3+
if (env === 'rollup') {
4+
module.exports = {
5+
presets: [
6+
[
7+
'env',
8+
{
9+
modules: false,
10+
},
11+
],
12+
'stage-2',
13+
'react',
14+
],
15+
plugins: ['external-helpers'],
16+
};
17+
}
18+
19+
if (env === 'test') {
20+
module.exports = {
21+
comments: false,
22+
plugins: ['transform-es2015-modules-commonjs'],
23+
presets: ['react', 'stage-2'],
24+
};
25+
}

package.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Drag-and-drop sortable component for nested data and hierarchies",
55
"scripts": {
66
"prebuild": "npm run lint",
7-
"build": "npm run clean && rollup -c",
7+
"build": "npm run clean && NODE_ENV=rollup rollup -c",
88
"build:storybook": "npm run clean:storybook && build-storybook -o example/build/storybook",
99
"clean": "rimraf dist",
1010
"clean:storybook": "rimraf example/build/storybook",
@@ -18,6 +18,11 @@
1818
},
1919
"main": "dist/index.cjs.js",
2020
"module": "dist/index.esm.js",
21+
"babel": {
22+
"presets": [
23+
"./.babelrc.js"
24+
]
25+
},
2126
"files": [
2227
"dist",
2328
"style.css"

0 commit comments

Comments
 (0)