Deprecated, use Vue CLI instead.
This is a Webpack + Vue.js boilerplate that heavy inspired by vuejs-templates/webpack with these features:
- Apply Autoprefixer outside of
.vue
components. See vuejs-templates/webpack#600. - Use webpack-dev-server instead of custom develop server.
- Simple config.
- Not lint-on-save with ESLint: run
npm run lint
instead. This make me easy to debug code temporary. - Use relative public path by default. See vuejs-templates/webpack#200.
- Keep source map path comment in the CSS files after a production build. See NMFR/optimize-css-assets-webpack-plugin#6.
- Apply Babel plugins with babel-preset-env.
- Use HashedModuleIdsPlugin to keep module ids consistent. See vuejs-templates/webpack#406.
- Similar to JS, also split CSS to
vendor.css
andmain.css
. See vuejs-templates/webpack#598. - Ready to use
import('./path/to/module')
syntax to code-splitting.
...and other little improve.
- Clone this template use Git or download it.
- Install dependencies:
npm install
Now you have three commands:
npm start
npm run build
npm run lint
: Lint code with ESLint (use JavaScript Standard Style rules)
This boilerplate use Sass by default so I specified node-sass
and sass-loader
in package.json, but if you want use less or stylus, you need install then by yourself:
npm install less-loader --save-dev
npm install stylus-loader --save-dev
FOR CHINESE USER: 如果你在安装 node-sass
时遇到问题,请参考这篇文章解决:安装 node-sass 的正确姿势