Skip to content

Commit

Permalink
add missing ts plugin for lib build in babel
Browse files Browse the repository at this point in the history
  • Loading branch information
clementdevos committed Nov 6, 2020
1 parent adb9ab5 commit f4958f8
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
14 changes: 12 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
{
"presets": ["@babel/preset-react", "@babel/preset-env"],
"presets": [
"@babel/preset-react",
"@babel/preset-env",
[
"@babel/preset-typescript",
{
"isTSX": true,
"allExtensions": true
}
]
],
"plugins": [
[
"@babel/plugin-transform-runtime",
{
regenerator: true
"regenerator": true
}
],
"@babel/plugin-proposal-optional-chaining",
Expand Down
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
#package files
components/
i18n/
index.js
store/
styles
/utils
#build files
build
.env.*
./lib/
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"eject": "react-scripts eject",
"test": "react-scripts test",
"prepackage": "rimraf lib ",
"package": "./node_modules/.bin/babel src/package -d .",
"package": "./node_modules/.bin/babel --extensions '.ts,.tsx,.js,.jsx' src/package -d .",
"postpackage": "cp-cli src/package/i18n i18n && cp-cli src/package/assets assets",
"test-build": "rimraf ./test-build && ./node_modules/.bin/babel src -d ./test_build",
"test-build": "rimraf ./test-build && ./node_modules/.bin/babel --extensions '.ts,.tsx,.js,.jsx' src -d ./test_build",
"posttest-build": "rimraf ./test_build ./styles ",
"build": "react-scripts build",
"build:messages": "NODE_ENV=production babel ./src >/dev/null",
Expand Down Expand Up @@ -77,6 +77,7 @@
"@babel/plugin-transform-runtime": "^7.9.0",
"@babel/preset-env": "^7.9.0",
"@babel/preset-react": "^7.9.4",
"@babel/preset-typescript": "^7.12.1",
"@testing-library/jest-dom": "5.3.0",
"@testing-library/react": "10.0.1",
"babel-plugin-css-modules-transform": "^1.6.2",
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,7 @@
"@babel/plugin-transform-react-jsx-self" "^7.9.0"
"@babel/plugin-transform-react-jsx-source" "^7.9.0"

"@babel/preset-typescript@7.12.1":
"@babel/preset-typescript@7.12.1", "@babel/preset-typescript@^7.12.1":
version "7.12.1"
resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.12.1.tgz#86480b483bb97f75036e8864fe404cc782cc311b"
integrity sha512-hNK/DhmoJPsksdHuI/RVrcEws7GN5eamhi28JkO52MqIxU8Z0QpmiSOQxZHWOHV7I3P4UjHV97ay4TcamMA6Kw==
Expand Down

0 comments on commit f4958f8

Please sign in to comment.