Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to config with typescript #12

Open
AntoninSorrento opened this issue Oct 10, 2018 · 5 comments
Open

how to config with typescript #12

AntoninSorrento opened this issue Oct 10, 2018 · 5 comments

Comments

@AntoninSorrento
Copy link

how to config with typescript?

@AntoninSorrento
Copy link
Author

i did it

@karol-majewski
Copy link

@AntoninSorrento Congratulations! Would you mind sharing your solution for others to see?

@AntoninSorrento
Copy link
Author

AntoninSorrento commented Oct 19, 2018

@karol-majewski assuredly

Config with TypeScript

keep this package's config ,some file need change

1 change -> .babelrc

  {
  "presets": [
    "@babel/preset-env"
  ],
  "plugins": [
    [
      "import",
      {
        "libraryName": "antd",
        "libraryDirectory": "es",
        "style": true
      }
    ]
  ]
}

2. add -> 'tsconfig.json'

{
  "compilerOptions": {
    "module": "esnext",
    "target": "es5",
    "lib": [
      "es6",
      "dom"
    ],
    "moduleResolution": "node",
    "rootDir": "src",
    "jsx": "react",
    "allowJs": true,
    "forceConsistentCasingInFileNames": true,
    "suppressImplicitAnyIndexErrors": true,
    "noUnusedLocals": true,
    "allowSyntheticDefaultImports": true,
    "experimentalDecorators": true
  },
  "exclude": [
    "node_modules",
    "build"
  ]
}

3. check package.json

image

start now!

image

@karol-majewski
Copy link

Thank you @AntoninSorrento!

@wangyongf
Copy link

Thank you @AntoninSorrento

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants