Skip to content

Commit

Permalink
ci: use separate babel config for src and test
Browse files Browse the repository at this point in the history
  • Loading branch information
yunnysunny committed May 3, 2022
1 parent 38bc6cb commit 1330634
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 23 deletions.
26 changes: 10 additions & 16 deletions .lib.babelrc
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
{
"presets": [
["@babel/env", {
"targets": {
"node": "6.4.0",
"browsers": [ "> 1%", "last 2 versions", "ie 9" ]
}
}]
],
"plugins": [
["@babel/transform-runtime"]
],
"parserOpts": {
"allowReturnOutsideFunction": true
},
"sourceMaps": "inline"
}
"presets": [
["@babel/env", {
"targets": {
"node": "6.4.0",
"browsers": [ "> 1%", "last 2 versions", "ie 9" ]
}
}]
],
"sourceMaps": "inline"
}
17 changes: 17 additions & 0 deletions .test.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"presets": [
["@babel/env", {
"targets": {
"node": "6.4.0",
"browsers": [ "> 1%", "last 2 versions", "ie 9" ]
}
}]
],
"plugins": [
["@babel/transform-runtime"]
],
"parserOpts": {
"allowReturnOutsideFunction": true
},
"sourceMaps": "inline"
}
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"@babel/core": "^7.17.9",
"@babel/plugin-transform-runtime": "^7.17.0",
"@babel/preset-env": "^7.16.11",
"@babel/runtime": "^7.17.9",
"Base64": "^1.1.0",
"babelify": "^10.0.0",
"basic-auth-connect": "^1.0.0",
Expand Down Expand Up @@ -70,9 +71,9 @@
"eslint-config-xo-lass": "^1.0.6",
"eslint-plugin-compat": "^4.0.2",
"eslint-plugin-node": "^11.1.0",
"husky": "^7.0.4",
"husky": "^7.0.4",
"lint-staged": "^12.4.1",
"remark-cli": "^10.0.1",
"remark-cli": "^10.0.1",
"remark-preset-github": "^4.0.1",
"xo": "^0.48.0"
},
Expand Down Expand Up @@ -156,7 +157,7 @@
"build:clean": "rimraf lib dist",
"build:dist": "npm run browserify && npm run minify",
"build:lib": "babel --config-file ./.lib.babelrc src --out-dir lib",
"build:test": "babel --config-file ./.lib.babelrc test --out-dir lib/node/test",
"build:test": "babel --config-file ./.test.babelrc test --out-dir lib/node/test",
"coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov",
"lint": "eslint -c .eslintrc src test && remark . -qfo && eslint -c .lib.eslintrc lib/**/*.js && eslint -c .dist.eslintrc dist/**/*.js",
"minify": "cross-env NODE_ENV=production browserify src/node/index.js -o dist/superagent.min.js -s superagent -g [ babelify --configFile ./.dist.babelrc ] -p tinyify",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@
"@babel/types" "^7.4.4"
esutils "^2.0.2"

"@babel/runtime@^7.8.4":
"@babel/runtime@^7.17.9", "@babel/runtime@^7.8.4":
version "7.17.9"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.17.9.tgz#d19fbf802d01a8cb6cf053a64e472d42c434ba72"
integrity sha512-lSiBBvodq29uShpWGNbgFdKYNiFDo5/HIYsaCEY9ff4sb10x9jizo2+pRrSyF4jKZCXqgzuqBOQKbUm90gQwJg==
Expand Down Expand Up @@ -1330,7 +1330,7 @@
resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.6.tgz#250a7b16c3b91f672a24552ec64678eeb1d3a08d"
integrity sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ==

"@typescript-eslint/eslint-plugin@*":
"@typescript-eslint/eslint-plugin@^5.11.0":
version "5.22.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.22.0.tgz#7b52a0de2e664044f28b36419210aea4ab619e2a"
integrity sha512-YCiy5PUzpAeOPGQ7VSGDEY2NeYUV1B0swde2e0HzokRsHBYjSdF6DZ51OuRZxVPHx0032lXGLvOMls91D8FXlg==
Expand All @@ -1345,7 +1345,7 @@
semver "^7.3.5"
tsutils "^3.21.0"

"@typescript-eslint/parser@*":
"@typescript-eslint/parser@^5.11.0":
version "5.22.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.22.0.tgz#7bedf8784ef0d5d60567c5ba4ce162460e70c178"
integrity sha512-piwC4krUpRDqPaPbFaycN70KCP87+PC5WZmrWs+DlVOxxmF+zI6b6hETv7Quy4s9wbkV16ikMeZgXsvzwI3icQ==
Expand Down Expand Up @@ -3939,7 +3939,7 @@ eslint-config-xo-lass@^1.0.6:
resolved "https://registry.yarnpkg.com/eslint-config-xo-lass/-/eslint-config-xo-lass-1.0.6.tgz#6c27c2b694aea2e3ebc49ab50b4699ce747a5a5b"
integrity sha512-C/oftF0mIBWuuj9tiy41qS1EmpXryEu9oVmoujNOnC31Ouyhvj8rQ4RgRn7QMBGs0vSbShq9TAZyLb3rPh2Ozw==

eslint-config-xo-typescript@*:
eslint-config-xo-typescript@^0.50.0:
version "0.50.0"
resolved "https://registry.yarnpkg.com/eslint-config-xo-typescript/-/eslint-config-xo-typescript-0.50.0.tgz#59a0a704fbd667592ca3ddcc599b9f8c855e4ebe"
integrity sha512-Ru2tXB8y2w9fFHLm4v2AVfY6P81UbfEuDZuxEpeXlfV65Ezlk0xO4nBaT899ojIFkWfr60rP9Ye4CdVUUT1UYg==
Expand Down

0 comments on commit 1330634

Please sign in to comment.