在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/HTML/ nuxt項目打包部署問題

nuxt項目打包部署問題

第一次使用nuxt開發(fā),菜狗求指點~

該項目是一個純靜態(tài)的項目,為滿足seo需求使用nuxt開發(fā),使用 starter 模板創(chuàng)建,項目開發(fā)完成后,使用 npm run build 打包項目之后,生成的dist中只有一個_nuxt文件夾,連index.html入口文件都沒有。

因為是純靜態(tài)文件,所以服務(wù)器端并沒有部署node環(huán)境,求教下這種情況下怎么部署,如果要裝node環(huán)境的話,要怎么部署。

問題一:
npm run build 之后 按照sg上大佬的文章 直接 npm start 也會報如下錯誤:

clipboard.png

問題二
此外,自從npm run build之后,之前開發(fā)環(huán)境項目也run不起來了,報了如下錯誤:

clipboard.png

我并沒有配置任何middleware, 在這個報錯的基礎(chǔ)上,刷新再次報錯

clipboard.png

以下為我的 nuxt.config.js 配置項

module.exports = {
  /*
  ** Headers of the page
  */
  head: {
    title: 'test Title',
    meta: [
      {charset: 'utf-8'},
      {name: 'viewport', content: 'initial-scale=1, maximum-scale=3, minimum-scale=1, user-scalable=no'},
      {hid: 'description', name: 'description', content: 'Test Title'}
    ],
    link: [
      {rel: 'icon', type: 'image/x-icon', href: '/favicon.ico'}
    ]
  },
  /*
  ** Customize the progress bar color
  */
  loading: './components/loading.vue',
  css: [
    {src: '~assets/style/main.scss', lang: 'scss'}
  ],
  plugins: [
    {src: '~plugins/vconsole', ssr: false}
  ],
  /*
  ** Build configuration
  */
  build: {
    postcss: [
      require('autoprefixer')({
        browsers: ['last 3 versions']
      })
    ],
    babel: {
      presets: ['es2015', 'stage-0'],
      plugins: ['transform-runtime']
    },
    vendor: ['babel-polyfill', 'weixin-js-sdk'],
    /*
    ** Run ESLint on save
    */
    extend(config, {isDev, isClient}) {
      if (isDev && isClient) {
        config.module.rules.push({
          enforce: 'pre',
          test: /\.(js|vue)$/,
          loader: 'eslint-loader',
          exclude: /(node_modules)/
        })
      }
    }
  }
}

package.json 如下:

{
  "name": "official-website",
  "version": "1.0.0",
  "description": "Nuxt.js project",
  "author": "xqFE",
  "config": {
    "nuxt": {
      "host": "0.0.0.0",
      "port": "3333"
    }
  },
  "scripts": {
    "dev": "nuxt",
    "build": "nuxt build",
    "start": "nuxt start",
    "generate": "nuxt generate",
    "lint": "eslint --ext .js,.vue --ignore-path .gitignore .",
    "precommit": "npm run lint"
  },
  "dependencies": {
    "babel-polyfill": "^6.26.0",
    "chimee-player": "^1.1.10",
    "clipboard": "^1.7.1",
    "nuxt": "^1.0.0",
    "sweet-modal-vue": "^2.0.0",
    "vconsole": "^3.1.0",
    "vue-awesome-swiper": "^3.1.0",
    "vue-countup-v2": "^0.1.2",
    "vue-touch-ripple": "^2.4.0",
    "weixin-js-sdk": "^1.2.0"
  },
  "devDependencies": {
    "babel-eslint": "^7.2.3",
    "babel-plugin-transform-runtime": "^6.23.0",
    "babel-preset-es2015": "^6.24.1",
    "babel-preset-stage-0": "^6.24.1",
    "eslint": "^4.3.0",
    "eslint-config-standard": "^10.2.1",
    "eslint-loader": "^1.9.0",
    "eslint-plugin-html": "^3.1.1",
    "eslint-plugin-import": "^2.7.0",
    "eslint-plugin-node": "^5.1.1",
    "eslint-plugin-promise": "^3.5.0",
    "eslint-plugin-standard": "^3.0.1",
    "node-sass": "^4.7.2",
    "pug": "^2.0.0-rc.4",
    "sass-loader": "^6.0.6"
  }
}

問題三

嘗試用 generate 生成靜態(tài)頁面,也報了各種錯誤,就是所有的路由錯誤

clipboard.png

路由結(jié)構(gòu)如下:

clipboard.png

再次求各位大佬指點~

回答
編輯回答
咕嚕嚕

我是按照http://jspang.com/2018/02/26/...
的視頻教程安裝的,沒有報錯,
但是不知道怎么使用vue-awesome-swiper,你是怎么用的?

2018年7月6日 06:02
編輯回答