A
A
alex5e2017-04-06 00:14:04
JavaScript
alex5e, 2017-04-06 00:14:04

How to make it easier to build a vuejs webpack project?

Webpack, when building a project on vue.js, collects a bunch of files in build assets
7e26ba59dd494d529b77405b94384ab1.png
But only app, vendor and manifest are included on the page

module.exports = {
  build: {
    env: require('./prod.env'),
    index: path.resolve(__dirname, '../dist/index.html'),
    assetsRoot: path.resolve(__dirname, '../dist'),
    assetsSubDirectory: 'assets',
    assetsPublicPath: '/',
    productionSourceMap: false,
    // Gzip off by default as many popular static hosts such as
    // Surge or Netlify already gzip all static assets for you.
    // Before setting to `true`, make sure to:
    // npm install --save-dev compression-webpack-plugin
    productionGzip: false,
    productionGzipExtensions: ['js', 'css']
  }
}

The whole assembly takes about 10 minutes, is it possible to somehow "facilitate" this process?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Kitmanov, 2017-04-06
@k12th

What is in the picture is the so-called. chunks. Webpack diligently shows them, but it is difficult to extract useful information from there. Although you can see that some js hangs two megabytes, and two more - 700 and 600 kilobytes, figure it out.
The build time depends on the size of the application, on the number of libraries included, on the babel plugins used, and on what you are doing with the code (creating detailed source-maps, for example, is a time-consuming operation, but they are not very necessary in production).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question