vue-springbud

不是最简洁的 Vue 生产环境模板

Downloads
9
Stars
24
Committers
1

vue-springbud

Vue

  • HTML
  • Stylus
  • CSS

npm install
npm run dev-local

dev-server localhost:9000

npm run dev

CSS hash

npm run build

build/config.js

JS src HTML src/templates src

 index.js             # Webpack  JS
 App.vue              # Vue 
 assets               #  / 
  logo.png
 components           #  .vue  JS
  Hello.vue
 styl                 # 
  mixins.styl
  variables.styl
 templates            #  JS  HTML 
     index.html

JS dist HTML pages run prod CSS dist/css 15K JS

JS index / vendor / manifest manifest index vendor Webpack manifest vendor

JS HTML resourcesHTML View applications/view http://demo.com/foo/bar/resources/bundle.js

var bundlePath = path.join(process.cwd(), './resources')
var htmlPath = path.join(process.cwd(), './applications/view')
// ...
output: {
  publicPath: '/foo/bar/resources/'
}

index foo entry

var entry = {
  index: './src/index.js',
  foo: './src/foo.js',
  vendor: ['vue']
}

src/foo.js src/templates/foo.html webpack

Vue vendor.bundle.js entry vendor

var entry = {
  index: './src/index.js',
  foo: './src/foo.js',
  vendor: ['vue', 'chart.js', 'vue-router'] // ...
}

CSS

src node_modules CSS

/*  src/styl/foo.css */
@import '~styl/foo.css';

/*  npm install  CSS  */
@import '~normalize.css';

devServer API module.exports.devServer proxy

{
  // ...
  proxy: {
    '/api': { target: 'http://backend-address/' }
  }
}

JS

Vue JS templates/index.html pages/index.html

Webpack Webpack Configuration

Changelog

  • 0.2.1
    • ES6
    • dev server
  • 0.2.0
    • CSS
    • stylus
    • Yarn
    • JS
  • 0.1.2 stylus CSS
  • 0.1.1 vue runtime
  • 0.1.0 Webpack 2
Package Rankings
Top 26.58% on Npmjs.org