Giter Club home page Giter Club logo

tsc-react-webpack's Introduction

目录结构

+- src/ | +- components | +- dist/

Install

init project

npm init

install dependencies

npm install -g typescript typings webpack
  • webpack
  • typings 是一个包管理器,它是用来获取定义文件的
  • typescript
npm install --save react react-dom
npm install --save-dev ts-loader source-map-loader
npm link typescript
  • ts-loader可以让webpack使用TypeScript的标准配置文件tsconfig.json编译TypeScript代码
  • source-map-loader使用TypeScript输出的sourcemap文件来告诉webpack何时生成自己的sourcemaps
  • 链接TypeScript,允许ts-loader使用全局安装的TypeScript,而不需要单独的本地拷贝。 如果你想要一个本地的拷贝,执行npm install typescript

使用typings工具来获取React的声明文件:

typings install --global --save "dt~react"
typings install --global --save "dt~react-dom"

--global标记,还有dt~前缀,告诉Typings从DefinitelyTyped获取声明文件,它是一个由社区维护的.d.ts文件仓库。 这个命令会创建一个名为typings.json的文件和一个typings目录在当前目录下。

tsc-react-webpack's People

Contributors

fengyun2 avatar ly2011 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.