vue-multiple-page

vue + webpack 多页/单页 脚手架

Stars
168
Committers
1

vue-multiple-page

es6-7-8cssnext+vuevuewebpackwebpack#

git clone https://github.com/Mrminfive/vue-multiple-page.git
cd vue-multiple-page
npm install
npm run dev

production()``production-d() development()

DllPlugin + DllReferencePlugin manifest static/libs/js

dev

npm run dev

build

npm run build

build:d

npm run build:d

dll()

npm run build:vendors

build:vendors

.
 README.md
 build
  build-d.js
  build.js
  dev-client.js
  dev.js
  util.js
  webpack.base.config.js
  webpack.dev.config.js
  webpack.dll.config.js
  webpack.prod.config.js
 config
  base.js
  dev.env.js
  index.js
  prod-d.env.js
  prod.env.js
  util.js
 package-lock.json
 package.json
 src
     pages
      common
       js
           common.js
      index (1index)
       index.html
       js
        index.js
       style
      page2 (2)
          index.html
          js
           index.js
          style
     static ()
         libs
          js (js)
              manifest_vendors.json
              vendors.js
         test.txt

**: src/pages common !(_)*/!(_)*.html htmlhtml js index.js webpack

.my-page ()
 index.html (html)
 js
  index.js ()
 style ()

.
 css
  index.3f05035e.css
  index.3f05035e.css.map
  page2.3f05035e.css
  page2.3f05035e.css.map
 js
  index.3f05035ea26e8a6c3eb8.js
  index.3f05035ea26e8a6c3eb8.js.gz
  index.3f05035ea26e8a6c3eb8.js.map
  page2.3f05035ea26e8a6c3eb8.js
  page2.3f05035ea26e8a6c3eb8.js.map
 static ()
    libs
     js
         manifest_vendors.json
         vendors.js
    test.txt
 index.html
 page2.html

config/base.js

{
    isMultiplePage: true,
    // 
    isOpenSyncImport: true,
    // chunk
    minChunkSize: 10000,
    // dev
    autoOpenBrowser: true,
    // 
    assetsRoot: path.resolve(__dirname, '../src'),
    // 
    buildRoot: path.resolve(__dirname, '../dist'),
    // 
    staticAssets: 'static',
    // 
    publicPath: '/',
    // 
    commonAlias: {
        Static: 'static',
        '@': 'pages'
    },
    // 
    externals: {
        // '$': 'JQuery'
    },
    // (commonjs`commons chunk`)
    commons: {
        // demo: path.resolve(__dirname, '../src/pages/index/js/demo.js')
    },
    // 
    library: [
        'axios',
        'vue',
        'vue-router'
    ],
    // ()
    libraryEntry: [
        // 'index',
        // 'page2'
    ],
    // 
    port: 8009,
    // 
    proxy: {
        // '/api': {
        //  target: "http://*.com",
        //  changeOrigin: true,
        //  pathRewrite: {
        //      '^/api': ''
        //  },
        //  logLevel: 'error'
        // }
    }
}
  • isMultiplePage
  • isOpenSyncImport commons
  • minChunkSize chunk (isOpenSyncImport true )
  • autoOpenBrowser dev
  • assetsRoot URLwebpack
  • buildRoot URLwebpack
  • staticAssets
  • publicPath URLwebpack
  • commonAlias webpack
  • externals webpack
  • commons commonjscommons chunk isOpenSyncImport
  • library
  • libraryEntry ()
  • port 8009
  • proxy http-proxy-middleware

Related Projects