A simple TypeScript CLI for scaffolding Vue.js projects.
$ npm install -g vue-cli
vue init SimonZhangITer/vue-typescript-template <project-name>
$ vue init SimonZhangITer/vue-typescript-template my-project
The above command pulls the template from here, prompts for some information, and generates the project at
i wrote a vue-typescript-demo project for practice, it recorded how I configured it and how to use vue.js with typescript
vuexoption at initialization time, it will create
src/storefolder, and it had configed, like this:
src ├──store ├──actions.ts ├──mutations.ts ├──getters.ts ├──types.ts
vue-class-componetby default, and vue perfect support for it, it will make your code more flat and beautiful, you will like it.
npm run dev: first-in-class development experience.
- Webpack +
vue-loaderfor single file Vue components.
- State preserving hot-reload
- State preserving compilation error overlay
- Lint-on-save with ESLint
- Source maps
- Webpack +
npm run build: Production ready build.
- HTML minified with html-minifier.
- CSS across all components extracted into a single file and minified with cssnano.
- Static assets compiled with version hashes for efficient long-term caching, and an auto-generated production
index.htmlwith proper URLs to these generated assets.
npm run build --reportto build with bundle size analytics.
- Supports ES2015+ in test files.
- Easy mocking.
npm run e2e: End-to-end tests with Nightwatch.
- Run tests in multiple browsers in parallel.
- Works with one command out of the box:
- Selenium and chromedriver dependencies automatically handled.
- Automatically spawns the Selenium server.