Skip to content
This repository was archived by the owner on Dec 10, 2021. It is now read-only.

u-sho/nuxt2.9-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

$ npx vue init u-sho/nuxt2.9-template/ my-project
$ cd my-project

# install dependencies
$ yarn install # Or npm install

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

If you need git

$ git init

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

Usage

Development

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

Go to http://localhost:3000

Production

# build for production and launch the server
$ yarn build
$ yarn start

Generate

# generate a static project
$ yarn generate

Linting

# eslint for javascript, typescript, and vue file
$ yarn lint
$ yarn lint --fix

# stylelint for css, scss, and vue file
$ yarn slint
$ yarn slint --fix

Type Check

# typecheck of typescript
$ yarn tsc

Test

# test vue components by jest or ts-jest
$ 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