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.

webpack-plugins.js 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. let webpack = require('webpack');
  2. let FriendlyErrorsWebpackPlugin = require('friendly-errors-webpack-plugin');
  3. let MixDefinitionsPlugin = require('../webpackPlugins/MixDefinitionsPlugin');
  4. let BuildCallbackPlugin = require('../webpackPlugins/BuildCallbackPlugin');
  5. let CustomTasksPlugin = require('../webpackPlugins/CustomTasksPlugin');
  6. let ManifestPlugin = require('../webpackPlugins/ManifestPlugin');
  7. let MockEntryPlugin = require('../webpackPlugins/MockEntryPlugin');
  8. module.exports = function() {
  9. let plugins = [];
  10. // If the user didn't declare any JS compilation, we still need to
  11. // use a temporary script to force a compile. This plugin will
  12. // handle the process of deleting the compiled script.
  13. if (!Mix.bundlingJavaScript) {
  14. plugins.push(new MockEntryPlugin());
  15. }
  16. // Activate better error feedback in the console.
  17. plugins.push(
  18. new FriendlyErrorsWebpackPlugin({
  19. clearConsole: Config.clearConsole
  20. })
  21. );
  22. // Activate support for Mix_ .env definitions.
  23. plugins.push(
  24. MixDefinitionsPlugin.build({
  25. NODE_ENV: Mix.inProduction()
  26. ? 'production'
  27. : process.env.NODE_ENV || 'development'
  28. })
  29. );
  30. // Handle all custom, non-webpack tasks.
  31. plugins.push(new ManifestPlugin());
  32. // Handle all custom, non-webpack tasks.
  33. plugins.push(new CustomTasksPlugin());
  34. // Notify the rest of our app when Webpack has finished its build.
  35. plugins.push(
  36. new BuildCallbackPlugin(stats => Mix.dispatch('build', stats))
  37. );
  38. return plugins;
  39. };