项目作者: u-sho

项目描述 :
Template of nuxt@^2.9.0 + TypeScript + jest
高级语言: Vue
项目地址: git://github.com/u-sho/nuxt2.9-template.git
创建时间: 2019-12-18T06:24:25Z
项目社区:https://github.com/u-sho/nuxt2.9-template

开源协议:MIT License

下载


nuxt2.9-template

NOTE: create-nuxt-app-ts is merged. You can use it.

日本語版

This is a starter template for nuxt@^2.9 & TypeScript & jest.
Now, this is working on nuxt@2.11.0

This is like a fork of starter-template provided by nuxt-community.

Starter

A Nuxt.js starter project template without the distraction of a complicated development.

  • nuxt.config.ts
  • tsconfig.json
  • .eslintrc.js
  • stylelint.config.json
  • .prettierrc
  • axios *
  • ts-jest *
  • sass-loader *

You can customize * options

Installation

This is a project template for vue-cli.

  1. $ npx vue init u-sho/nuxt2.9-template/ my-project
  2. $ cd my-project
  3. # install dependencies
  4. $ yarn install # Or npm install

Makesure to use a version of vue-cli >= 2.1 (`vue -V).

If you need git

  1. $ git init

NOTE: If you don’t use git, .gitignore is important. .gitignore is used by ESlint & stylelint.

Usage

Development

  1. # serve with hot reloading at localhost:3000
  2. $ yarn dev

Go to http://localhost:3000

Production

  1. # build for production and launch the server
  2. $ yarn build
  3. $ yarn start

Generate

  1. # generate a static project
  2. $ yarn generate

Linting

  1. # eslint for javascript, typescript, and vue file
  2. $ yarn lint
  3. $ yarn lint --fix
  4. # stylelint for css, scss, and vue file
  5. $ yarn slint
  6. $ yarn slint --fix

Type Check

  1. # typecheck of typescript
  2. $ yarn tsc

Test

  1. # test vue components by jest or ts-jest
  2. $ yarn test

Customization

  • Uninstall Sass: check this PR #1 and edit package.json, stylelint.config.js. After that, remove node_modules/ and Re:yarn install

  • Uninstall jest: check this PR #3 and edit package.json. After that, remove test/ and node_modules and Re:yarn install

  • Uninstall axios: check this PR #5 and edit package.json, nuxt.config.ts, tsconfig.json. After that, remove node_modules/ and Re:yarn install

  • Uninstall TypeScript: Don’t use this. Use nuxt-create-app

  • Install PWA: check pwa.nuxtjs.org/ and edit package.json and nuxt.config.ts