Dashboard sipadu mbip
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MockEntryPlugin.js 842B

1234567891011121314151617181920212223242526272829
  1. class MockEntryPlugin {
  2. /**
  3. * Handle the deletion of the temporary mix.js
  4. * output file that was generated by webpack.
  5. *
  6. * This file is created when the user hasn't
  7. * requested any JavaScript compilation, but
  8. * webpack still requires an entry.
  9. *
  10. * @param {Object} compiler
  11. */
  12. apply(compiler) {
  13. compiler.plugin('done', stats => {
  14. let temporaryOutputFile = stats
  15. .toJson()
  16. .assets.find(asset => asset.name === 'mix.js');
  17. if (temporaryOutputFile) {
  18. delete stats.compilation.assets[temporaryOutputFile.name];
  19. File.find(
  20. path.resolve(Config.publicPath, temporaryOutputFile.name)
  21. ).delete();
  22. }
  23. });
  24. }
  25. }
  26. module.exports = MockEntryPlugin;