码迷,mamicode.com
首页 > 其他好文 > 详细

vue nuxt生成静态页面

时间:2018-08-09 13:46:49      阅读:1030      评论:0      收藏:0      [点我收藏+]

标签:project   sharp   stat   ios   http   mmu   start   使用命令   conf   

npm install -g vue-cli   //安装vue-cli架子

vue init nuxt-community/starter-template <project-name> //安装nuxt

npm run dev //开发运行, http://localhost:3000

 

如果需要生产静态文件使用命令:npm run generate

 

 

nuxt.config.js的一些配置

 

head: {
    script: [
      { src: ‘/‘ }/*外部js的引入,或者static中的js文件引入(/**.js)*/
    ]
  },
  env: {
    url: ‘http://***.com‘ /*全局asyncData({env})的配置,比如请求头URL常量*/
  },
  /*代理IP的使用*/
  proxy: [ [‘/api‘, {target: ‘http://**.com‘}] ], 
  build: {
    vendor: [‘axios‘, ‘qs‘],/*多个地方引用,防止多次打包*/
    }
  }

  

vue nuxt生成静态页面

标签:project   sharp   stat   ios   http   mmu   start   使用命令   conf   

原文地址:https://www.cnblogs.com/fm060/p/9447920.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!