Skip to content

Commit

Permalink
feat: add babel-plugin-import config
Browse files Browse the repository at this point in the history
  • Loading branch information
cncolder committed Jun 13, 2020
1 parent a208ab3 commit 68ec8d7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
12 changes: 12 additions & 0 deletions babel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const pkg = require('./package.json')

module.exports = [
'import',
{
libraryName: pkg.name,
libraryDirectory: 'dist',
camel2DashComponentName: false,
transformToDefaultImport: false,
},
'import ' + pkg.name,
]
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"files": [
"dist",
"docs",
"style"
"style",
"babel.js"
],
"repository": {
"type": "git",
Expand Down Expand Up @@ -61,7 +62,7 @@
"@types/classnames": "^2.2.10",
"@types/lodash": "^4.14.155",
"@types/node": "^14.0.13",
"@types/react": "^16.9.35",
"@types/react": "^16.9.36",
"@types/react-is": "^16.7.1",
"husky": "^4.2.5",
"np": "^6.2.4",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -357,10 +357,10 @@
"@types/prop-types" "*"
csstype "^2.2.0"

"@types/react@^16.9.35":
version "16.9.35"
resolved "https://registry.npm.taobao.org/@types/react/download/@types/react-16.9.35.tgz?cache=0&sync_timestamp=1589187921077&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Freact%2Fdownload%2F%40types%2Freact-16.9.35.tgz#a0830d172e8aadd9bd41709ba2281a3124bbd368"
integrity sha1-oIMNFy6Krdm9QXCboigaMSS702g=
"@types/react@^16.9.36":
version "16.9.36"
resolved "https://registry.npm.taobao.org/@types/react/download/@types/react-16.9.36.tgz?cache=0&sync_timestamp=1591784815359&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Freact%2Fdownload%2F%40types%2Freact-16.9.36.tgz#ade589ff51e2a903e34ee4669e05dbfa0c1ce849"
integrity sha1-reWJ/1HiqQPjTuRmngXb+gwc6Ek=
dependencies:
"@types/prop-types" "*"
csstype "^2.2.0"
Expand Down

0 comments on commit 68ec8d7

Please sign in to comment.