标签:product pac sas ring use ati frame esc 项目
Nuxt是基于Vue的一个应用框架,采用服务端渲染(SSR),可以让用户的Vue单页面应用(SPA)也可以有利于SEO。
参考:https://zh.nuxtjs.org/guide/installation
$ npm install -g npx
$ npx create-nuxt-app <项目名>
安装过程中的配置选项:
meituan-app
My neat Nuxt.js project
koa
element-ui
Universal
yes
yes
cedric
npm
$ npm install --update-binary
"scripts": {
"dev": "cross-env NODE_ENV=development nodemon server/index.js --watch server --exec babel-node",
"build": "nuxt build",
"start": "cross-env NODE_ENV=production node server/index.js --exec babel-node",
"generate": "nuxt generate",
"lint": "eslint --ext .js,.vue --ignore-path .gitignore .",
"precommit": "npm run lint"
},
如果报错:[nodemon] failed to start process, "babel-node" exec not found
需要安装:$ npm install babel-cli -S
$ npm install sass-loader node-sass
安装后可能会有提示:
npm WARN acorn-jsx@5.0.0 requires a peer of acorn@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-plugin-vue@4.7.1 requires a peer of eslint@^3.18.0 || ^4.0.0 but none is installed. You must install peer dependencies yourself.
此时,需要安装:
$ npm i eslint@^3.18.0
$ npm i acorn@^6.0.0
css: [
'element-ui/lib/theme-chalk/reset.css',
'element-ui/lib/theme-chalk/index.css'
],
...
build: {
/*
** You can extend webpack config here
*/
extend(config, ctx) {
// Run ESLint on save
if (ctx.isDev && ctx.isClient) {
config.module.rules.push({
enforce: 'pre',
test: /\.(js|vue)$/,
loader: 'eslint-loader',
exclude: /(node_modules)/
})
}
},
cache: true
}
标签:product pac sas ring use ati frame esc 项目
原文地址:https://www.cnblogs.com/cckui/p/10063550.html