zoukankan      html  css  js  c++  java
  • webpack 提升90%的构建速度 HardSourceWebpackPlugin

    HardSourceWebpackPlugin 插件 不能提升第一次构建的速度,但对于第二次构建能提升99%的构建速度

    第一次构建:

     第二次:

    提升了。。,算不出来,反正就是很多啦~~~

    npm install --save hard-source-webpack-plugin
    // webpack.config.js
    var HardSourceWebpackPlugin = require('hard-source-webpack-plugin');
    
    new HardSourceWebpackPlugin({
      // Either an absolute path or relative to webpack's options.context.
      cacheDirectory: 'node_modules/.cache/hard-source/[confighash]',
      // Either an absolute path or relative to webpack's options.context.
      // Sets webpack's recordsPath if not already set.
      recordsPath: 'node_modules/.cache/hard-source/[confighash]/records.json',
      // Either a string of object hash function given a webpack config.
      configHash: function(webpackConfig) {
        // node-object-hash on npm can be used to build this.
        return require('node-object-hash')({sort: false}).hash(webpackConfig);
      },
      // Either false, a string, an object, or a project hashing function.
      environmentHash: {
        root: process.cwd(),
        directories: [],
        files: ['package-lock.json', 'yarn.lock'],
      },
    }),

    https://github.com/mzgoddard/hard-source-webpack-plugin

  • 相关阅读:
    vue脚手架项目配置后端接口(mock数据)
    list添加删除动画(transition-group)
    fast mock官网mock数据
    vuex日志插件(createLogger)
    环形进度条
    程序员的周末生活
    hbase错误之Region in transition异常解决
    不同虚拟机之间的文件传递
    windows上链接虚拟机
    hadoop——yarn
  • 原文地址:https://www.cnblogs.com/web-fusheng/p/8732620.html
Copyright © 2011-2022 走看看