Skip to content

Commit 9b632a1

Browse files
committed
build: use es/ instead of module/, add sideEffects: false, fix test:watch
1 parent e022a55 commit 9b632a1

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

.babelrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44
],
55
"env": {
66
"test": {
7+
"presets": [
8+
["env", {"targets": {"node": "current"}}],
9+
"stage-1", "flow"
10+
],
11+
"plugins": [
12+
"transform-runtime"
13+
]
14+
},
15+
"coverage": {
716
"presets": [
817
["env", {"targets": {"node": "current"}}],
918
"stage-1", "flow"

.flowconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[ignore]
22
<PROJECT_ROOT>/lib/.*
3-
<PROJECT_ROOT>/module/.*
3+
<PROJECT_ROOT>/es/.*
44

55
[include]
66
./src

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ coverage
22
.nyc_output
33
node_modules
44
lib
5-
module
5+
es
66
.eslintcache

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@
33
"version": "0.0.0-development",
44
"description": "my personal ES2015 library project skeleton",
55
"main": "lib/index.js",
6-
"module": "module/index.js",
6+
"module": "es/index.js",
7+
"sideEffects": false,
78
"scripts": {
89
"lint": "eslint src test --cache",
910
"lint:fix": "eslint --fix src test --cache",
1011
"lint:watch": "esw --watch src test --cache",
1112
"flow": "flow",
1213
"flow:coverage": "for file in src/**.js test/**.js; do echo $file; flow coverage $file; done",
1314
"flow:watch": "flow-watch -e js,js.flow,flowconfig --ignore lib/ --ignore node_modules/ --watch .flowconfig --watch src/ --watch test/",
14-
"build": "rimraf module && babel src --out-dir module && flow-copy-source -v src/ module && rimraf lib && BABEL_ENV=es5 babel src --out-dir lib && flow-copy-source -v src/ lib",
15-
"test": "NODE_ENV=production BABEL_ENV=es5 mocha $npm_package_config_mocha && NODE_ENV=production BABEL_ENV=test nyc --reporter=lcov --reporter=text mocha $npm_package_config_mocha",
16-
"test:watch": "mocha --watch $npm_package_config_mocha",
15+
"build": "rimraf es && babel src --out-dir es && flow-copy-source -v src/ es && rimraf lib && BABEL_ENV=es5 babel src --out-dir lib && flow-copy-source -v src/ lib",
16+
"test": "NODE_ENV=production BABEL_ENV=es5 mocha $npm_package_config_mocha && NODE_ENV=production BABEL_ENV=coverage nyc --reporter=lcov --reporter=text mocha $npm_package_config_mocha",
17+
"test:watch": "NODE_ENV=production BABEL_ENV=test mocha --watch $npm_package_config_mocha",
1718
"codecov": "nyc report --reporter=text-lcov > coverage.lcov; codecov",
1819
"commitmsg": "commitlint -e $GIT_PARAMS",
1920
"precommit": "npm run lint && flow",

0 commit comments

Comments
 (0)