How to use the filelist.md function in filelist

To help you get started, we’ve selected a few filelist examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github liangklfangl / commonsChunkPlugin_Config / chunk-module-assets / FileListPlugin.js View on Github external
console.log('chunk.name====',chunk);
    });



    const assets = compilation.getStats().toJson().assets;
    assets.forEach(function(asset,i){
      console.log('asset.name====',asset.name);
      console.log('asset.chunkNames====',asset.chunkNames);
       console.log('asset.chunks====',asset.chunks);
        console.log("----------------");
    });
    // 所有的chunk的都有name,但是通过require.ensure产生的chunk除外
    // console.log('++++++++',util.inspect(compilation.chunks,{showHidden:true,depth:3}));
    // Insert this list into the Webpack build as a new file asset:
    compilation.assets['filelist.md'] = {
      source: function() {
        return filelist;
      },
      size: function() {
        return filelist.length;
      }
    };

    callback();
  });
};
github fliphub / fliphub / packages / fliphub / src / hubs / BundlerHub / webpack / plugins / FileList.js View on Github external
compiler.plugin('emit', function(compilation, callback) {
    // Create a header string for the generated file:
    var filelist = 'In this build:\n\n'

    // Loop through all compiled assets,
    // adding a new line item for each filename.
    for (var filename in compilation.assets) {
      filelist += ('- ' + filename + '\n')
    }

    // Insert this list into the Webpack build as a new file asset:
    compilation.assets['filelist.md'] = {
      source() {
        return filelist
      },
      size() {
        return filelist.length
      },
    }

    callback()
  })
}
github fliphub / fliphub / packages / fliphub / src / presets / todo / PresetFileList.js View on Github external
compiler.plugin('emit', (compilation, callback) => {
    // Create a header string for the generated file:
    let filelist = 'In this build:\n\n'

    // Loop through all compiled assets,
    // adding a new line item for each filename.
    for (let filename in compilation.assets) {
      filelist += ('- ' + filename + '\n')
    }

    // Insert this list into the Webpack build as a new file asset:
    compilation.assets['filelist.md'] = {
      source() {
        return filelist
      },
      size() {
        return filelist.length
      },
    }

    callback()
  })
}

filelist

Lazy-evaluating list of files, based on globs or regex patterns

Apache-2.0
Latest version published 2 years ago

Package Health Score

65 / 100
Full package analysis

Popular filelist functions