Skip to content

Commit 2ac4c0a

Browse files
committed
build: make poly-package
1 parent 4371541 commit 2ac4c0a

File tree

5 files changed

+13
-5
lines changed

5 files changed

+13
-5
lines changed

.babelrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"plugins": [
33
"syntax-dynamic-import",
44
"transform-class-properties",
5-
"transform-export-extensions"
5+
"transform-export-extensions",
6+
"transform-object-rest-spread"
67
],
78
"presets": [
89
"flow"

.flowconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
[ignore]
22
<PROJECT_ROOT>/lib/.*
33
<PROJECT_ROOT>/es/.*
4+
<PROJECT_ROOT>/node_modules/fbjs/.*
5+
<PROJECT_ROOT>/node_modules/.*/fbjs/.*
46

57
[include]
68
./src

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
coverage
22
.nyc_output
3+
src
4+
lib
35
test
46
scripts
57
node_modules

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@
22
"name": "es2015-library-skeleton",
33
"version": "0.0.0-development",
44
"description": "my personal ES2015 library project skeleton",
5-
"main": "lib/index.js",
5+
"main": "index.js",
66
"module": "es/index.js",
7+
"modules.root": "es",
78
"sideEffects": false,
89
"scripts": {
910
"lint": "eslint src test --cache",
1011
"lint:fix": "eslint --fix src test --cache",
1112
"lint:watch": "esw --watch src test --cache",
1213
"flow": "flow",
1314
"flow:coverage": "for file in src/**.js test/**.js; do echo $file; flow coverage $file; done",
14-
"flow:watch": "flow-watch -e js,js.flow,flowconfig --ignore lib/ --ignore node_modules/ --watch .flowconfig --watch src/ --watch test/",
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",
15+
"flow:watch": "flow-watch -e js,js.flow,flowconfig --ignore es/ --ignore node_modules/ --watch .flowconfig --watch src/ --watch test/",
16+
"clean": "rimraf *.js *.js.flow && git checkout HEAD *.js",
17+
"build": "npm run clean && babel src --out-dir es && flow-copy-source -v src/ es && BABEL_ENV=es5 babel src --out-dir . && flow-copy-source -v src/ .",
1618
"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",
1719
"test:watch": "NODE_ENV=production BABEL_ENV=test mocha --watch $npm_package_config_mocha",
1820
"codecov": "nyc report --reporter=text-lcov > coverage.lcov; codecov",
@@ -66,6 +68,7 @@
6668
"babel-plugin-syntax-dynamic-import": "^6.18.0",
6769
"babel-plugin-transform-class-properties": "^6.24.1",
6870
"babel-plugin-transform-export-extensions": "^6.22.0",
71+
"babel-plugin-transform-object-rest-spread": "^6.26.0",
6972
"babel-plugin-transform-runtime": "^6.23.0",
7073
"babel-preset-env": "^1.7.0",
7174
"babel-preset-flow": "^6.23.0",

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,7 @@ babel-plugin-transform-flow-strip-types@^6.22.0:
954954
babel-plugin-syntax-flow "^6.18.0"
955955
babel-runtime "^6.22.0"
956956

957-
babel-plugin-transform-object-rest-spread@^6.22.0:
957+
babel-plugin-transform-object-rest-spread@^6.22.0, babel-plugin-transform-object-rest-spread@^6.26.0:
958958
version "6.26.0"
959959
resolved "https://registry.npmjs.org/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz#0f36692d50fef6b7e2d4b3ac1478137a963b7b06"
960960
dependencies:

0 commit comments

Comments
 (0)