Skip to content

Commit fad1e43

Browse files
committed
build with babel
1 parent bcb04b6 commit fad1e43

File tree

6 files changed

+480
-2091
lines changed

6 files changed

+480
-2091
lines changed

.babelrc

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"env": {
3+
"development": {
4+
"presets": [
5+
"env"
6+
],
7+
"plugins": [
8+
"transform-es2015-destructuring",
9+
"transform-object-rest-spread",
10+
"add-module-exports"
11+
]
12+
},
13+
"production": {
14+
"presets": [
15+
"es2015",
16+
"env",
17+
"minify"
18+
],
19+
"plugins": [
20+
"transform-es2015-destructuring",
21+
"transform-object-rest-spread",
22+
"add-module-exports"
23+
]
24+
}
25+
}
26+
}

.editorconfig

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# EditorConfig helps developers define and maintain
2+
# consistent coding styles between different editors and IDEs.
3+
4+
root = true
5+
6+
[*]
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
indent_style = space
12+
indent_size = 4

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ coverage
2222

2323
build/
2424
node_modules/
25+
lib/
2526
.npm
2627

2728
# Optional eslint cache

.npmignore

+8
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ coverage
2222

2323
build/
2424
node_modules/
25+
src/
2526
.npm
2627

2728
# Optional eslint cache
@@ -36,7 +37,14 @@ node_modules/
3637
# dotenv environment variables file
3738
.env*
3839

40+
.babelrc
41+
.editorconfig
42+
.gitignore
3943
.eslintrc
44+
.markdownlint.json
45+
.prettierignore
46+
.prettierrc
47+
.vscode
4048
yarn.lock
4149

4250
example.js

package.json

+18-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "intento-nodejs",
33
"description": "Intento API Client Library for Node.js",
44
"version": "0.0.5",
5-
"main": "src/index.js",
5+
"main": "lib/index.js",
66
"repository": "intento/intento-nodejs",
77
"author": "Intento Inc.",
88
"license": "Apache-2.0",
@@ -16,17 +16,30 @@
1616
"text meanings"
1717
],
1818
"scripts": {
19-
"build": "webpack",
19+
"clean": "rimraf lib",
20+
"lint": "eslint src test",
2021
"test": "jest --coverage --collectCoverageFrom=src/*.js --forceExit",
21-
"format": "prettier --config .prettierrc --write './**/*.js'"
22+
"build": "cross-env BABEL_ENV=production babel src --out-dir lib",
23+
"prepublish": "yarn clean && yarn lint && yarn test && yarn build",
24+
"format_source": "prettier --config .prettierrc --write './src/*.js'",
25+
"format_samples": "prettier --config .prettierrc --write './samples/**/*.js'",
26+
"format": "yarn format_source && yarn format_samples"
2227
},
2328
"devDependencies": {
29+
"babel-cli": "^6.26.0",
30+
"babel-core": "^6.26.3",
2431
"babel-eslint": "^8.2.2",
32+
"babel-plugin-add-module-exports": "^0.2.1",
33+
"babel-plugin-transform-es2015-destructuring": "^6.23.0",
34+
"babel-plugin-transform-object-rest-spread": "^6.26.0",
35+
"babel-preset-env": "^1.7.0",
36+
"babel-preset-es2015": "^6.24.1",
37+
"babel-preset-minify": "^0.4.1",
38+
"cross-env": "^5.1.5",
2539
"dotenv": "^5.0.1",
2640
"eslint": "^4.19.1",
2741
"jest": "^22.4.3",
2842
"prettier": "^1.12.1",
29-
"webpack": "^4.4.1",
30-
"webpack-cli": "^2.0.13"
43+
"rimraf": "^2.6.2"
3144
}
3245
}

0 commit comments

Comments
 (0)