Skip to content

Commit b0f4585

Browse files
committed
Update scripts
1 parent f5cf95d commit b0f4585

File tree

4 files changed

+36
-9
lines changed

4 files changed

+36
-9
lines changed

.babelrc

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,30 @@
11
{
2-
"presets": ["@babel/preset-es2016", "@babel/preset-es2015", "@babel/preset-react", ["@babel/preset-stage-2", { "decoratorsLegacy": true }]],
2+
"presets": [
3+
"@babel/preset-es2016",
4+
["@babel/preset-es2015", { "modules": false }],
5+
"@babel/preset-react",
6+
["@babel/preset-stage-2", { "decoratorsLegacy": true }]
7+
],
38
"plugins": ["@babel/plugin-transform-flow-strip-types"],
49
"env": {
510
"development": {
611
"plugins": ["react-hot-loader/babel"]
12+
},
13+
"test": {
14+
"presets": [
15+
"@babel/preset-es2016",
16+
"@babel/preset-es2015",
17+
"@babel/preset-react",
18+
["@babel/preset-stage-2", { "decoratorsLegacy": true }]
19+
]
20+
},
21+
"commonjs": {
22+
"presets": [
23+
"@babel/preset-es2016",
24+
"@babel/preset-es2015",
25+
"@babel/preset-react",
26+
["@babel/preset-stage-2", { "decoratorsLegacy": true }]
27+
]
728
}
829
}
930
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ coverage
44
.yarn-integrity
55
lib
66
build
7+
es

circle.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ deployment:
2727
master:
2828
branch: master
2929
commands:
30-
- npm run docs
30+
- npm run build:demo
31+
- npm run deploy

package.json

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"description": "Checkable list plugin for DraftJS",
55
"main": "lib/index.js",
66
"files": [
7-
"lib"
7+
"lib",
8+
"es"
89
],
910
"keywords": [
1011
"react",
@@ -23,17 +24,20 @@
2324
"test": "jest --verbose",
2425
"test:coverage": "npm test -- --coverage",
2526
"test:coverage:report": "npm run test:coverage && cat coverage/lcov.info | coveralls",
27+
"clean:es": "if [ -d es ]; then rm -rf es; fi",
2628
"clean:lib": "if [ -d lib ]; then rm -rf lib; fi",
2729
"build:css": "stylus --compress -p src/Button.styl | cat node_modules/draft-js-checkable-list-item/lib/CheckableListItem.css - > lib/plugin.css",
28-
"build:js": "babel -d lib src",
29-
"prebuild": "npm run clean:lib",
30+
"build:js": "npm run build:commonjs && npm run build:es",
31+
"build:es": "NODE_ENV=production BABEL_ENV=es babel -d es src",
32+
"build:commonjs": "NODE_ENV=production BABEL_ENV=commonjs babel -d lib src",
33+
"prebuild": "npm run clean:lib && npm run clean:es",
3034
"build": "npm run build:js && npm run build:css",
3135
"favicon": "curl https://sugarshin.net/favicon.ico > build/favicon.ico",
3236
"clean:build": "if [ -d build ]; then rm -rf build; fi",
33-
"predocs": "npm run clean:build; mkdir -p build && npm run favicon",
34-
"docs": "NODE_ENV=production webpack --progress",
35-
"postdocs": "gh-pages -x -m 'Update [ci skip]' -d build -r https://github.com/sugarshin/draft-js-checkable-list-plugin.git",
36-
"prepublishOnly": "npm run lint && npm run type && npm run test:coverage && NODE_ENV=production BABEL_ENV=production npm run build"
37+
"prebuild:demo": "npm run clean:build; mkdir -p build && npm run favicon",
38+
"build:demo": "NODE_ENV=production webpack",
39+
"deploy": "gh-pages -x -m 'Update [ci skip]' -d build -r https://github.com/sugarshin/draft-js-checkable-list-plugin.git",
40+
"prepublishOnly": "npm run lint && npm run type && npm run test:coverage && npm run build"
3741
},
3842
"repository": "git@github.com:sugarshin/draft-js-checkable-list-plugin.git",
3943
"author": "Shingo Sato <shinsugar@gmail.com>",

0 commit comments

Comments
 (0)