GithubHelp home page GithubHelp logo

git_vue_mnls's Introduction

nals

A Vue.js project

Build Setup

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

# build for production and view the bundle analyzer report
npm run build --report

# run e2e tests
npm run e2e

# run all tests
npm test

For a detailed explanation on how things work, check out the guide and docs for vue-loader.

// 以下针对本地运行,线上运行,注意build之后线上运行需要调整的地方,主要是各种路径 // 一般图片放在assets里面,路径会被webpack解析,而static的路径不会被解析,是固定的,(即表示assets被webpack当做模块解析,而static是看成静态资源,里面的资源一旦被引用,是不会在解析的) // html的相对路径都会解析,用static的图片该路径不会解析;js的路径不会解析,需要先import图片资源;css的路径会解析出错,一般在build/util.js里面的ExtractTextPlugin.extract进行配置相对路径 // 注意本地代理的使用方式

//userful tips: // 1.build-->utils-->if (options.extract) { // return ExtractTextPlugin.extract({ // use: loaders, // fallback: 'vue-style-loader', // publicPath:'../../' // }) // } else { // return ['vue-style-loader'].concat(loaders) // } //2. build的生产环境配置:env: require('./prod.env'), // index: path.resolve(__dirname, '../dist/index.html'), // 编译注入的 index.html 文件,必须是本地的绝对路径 // assetsRoot: path.resolve(__dirname, '../dist'), // 编译输出的静态资源根路径 // assetsSubDirectory: 'static', // 编译输出的二级目录 // assetsPublicPath: '/', // 编译发布上线路径的根目录,可配置为资源服务器域名或 CDN 域名 // productionSourceMap: true, //生成用于生产构建的源映射 3.后台没配置对应history路由资源时,使用mode:'history'页面是一片空白的,建议使用hash模式(默认模式); 4.IE不支持es6,导入babel-polyfill,在入口文件main.js中引用 5.然后直接丢到服务器,后端仍上去,就OK了

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.