- supports ES6 in all files, whether the webpack config file or node files
-
server:
- koa + koa-router
-
database:
- mongoose
-
front-end
- react+react-router+mobx
- writing separating webpack configurations for each environment
- use
webpack-mergeto merge these configurations together
using webpack.dll to precompile third packages can decrease the compilation time efficiently.
recommend to use yarn, because of faster speed and dependencies version management.
migrating from npm to yarn is easy, just replacing npm with yarn is OK.
yarn run startfor developmentyarn run buildfor front-end assets buildingyarn run servefor production
-
first:
yarn install -
second:
yarn run build-dll -
third:
developmentmode:yarn startjust starts your siteproductionmode:yarn run build-assetsto build the assets, and then runnpm run serveto run your site
note : the yarn run build-dll must be executed once before yarn run start or yarn run build-assets