Skip to content

imxiongying/antd-init

 
 

Repository files navigation

antd-init

NPM version

Ant Design boilerplate generator.


Feature

  • Generate a webpack workflow based boilerplate.
  • support ES2015 and less.
  • Local development via dora, support proxy, HMR and unit test.
  • support custom webpack.config,examples.

More usage: http://ant-tool.github.io/

Install

$ npm i antd-init -g

Usage

Generate boilerplate.

$ mkdir foo && cd foo
$ antd-init

// or with specify type
$ antd-init --type plain-react
$ antd-init --type redux

Start development server.

$ npm start

Build.

$ npm run build

Test.

$ npm test

Lint.

$ npm run lint

Don't work in IE8 ?

Since IE8 is don't supported in main react community, you should do follow steps to make it work:

  1. Open package.json

Modify dependency version.

- "react": "^15.0.2",
- "react-dom": "^15.0.2",
- "react-router": "^2.0.1",
+ "react": "0.14.x",
+ "react-dom": "0.14.x",
+ "react-router": "2.3.x"

Remove hmr plugin.

- "start": "dora -p 8001 --plugins   \"webpack,hmr,proxy,livereload?enableJs=false&injectHost=127.0.0.1,browser-history?index=/src/entries/index.html\"",
+ "start": "dora -p 8001 --plugins   \"webpack,proxy,livereload?enableJs=false&injectHost=127.0.0.1,browser-history?index=/src/entries/index.html\"",
  1. Open webpack.config.js, and enable es3ify-loader
// Enable this if you have to support IE8.
- // webpackConfig.module.loaders.unshift({
- //   test: /\.jsx?$/,
- //   loader: 'es3ify-loader',
- // });
+ webpackConfig.module.loaders.unshift({
+   test: /\.jsx?$/,
+   loader: 'es3ify-loader',
+ });

About

🔰 Ant Design boilerplate generator.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 95.6%
  • CSS 2.5%
  • HTML 1.6%
  • Makefile 0.3%