Dashboard sipadu mbip
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

index.js 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. |--------------------------------------------------------------------------
  3. | Welcome to Laravel Mix!
  4. |--------------------------------------------------------------------------
  5. |
  6. | Laravel Mix provides a clean, fluent API for defining basic webpack
  7. | build steps for your Laravel application. Mix supports a variety
  8. | of common CSS and JavaScript pre-processors out of the box.
  9. |
  10. */
  11. /**
  12. * We'll begin by pulling in a few globals that Mix often uses.
  13. */
  14. require('./helpers');
  15. require('dotenv').config();
  16. global.path = require('path');
  17. global.File = require('./File');
  18. /**
  19. * This config object is what Mix will reference, when it's time
  20. * to dynamically build up your Webpack configuration object.
  21. */
  22. global.Config = require('./config')();
  23. global.Mix = new (require('./Mix'))();
  24. /**
  25. * If we're working in a Laravel app, we'll explicitly
  26. * set the default public path, as a convenience.
  27. */
  28. if (Mix.sees('laravel')) {
  29. Config.publicPath = 'public';
  30. }
  31. /**
  32. * If the user activates hot reloading, with the --hot
  33. * flag, we'll record it as a file, so that Laravel
  34. * can detect it and update its mix() url paths.
  35. */
  36. Mix.listen('init', () => {
  37. if (Mix.shouldHotReload()) {
  38. let http = process.argv.includes('--https') ? 'https' : 'http';
  39. let port = process.argv.includes('--port')
  40. ? process.argv[process.argv.indexOf('--port') + 1]
  41. : Config.hmrOptions.port;
  42. new File(path.join(Config.publicPath, 'hot')).write(
  43. http + '://' + Config.hmrOptions.host + ':' + port + '/'
  44. );
  45. }
  46. });
  47. /**
  48. * Mix exposes a simple, fluent API for activating many common build
  49. * steps that a typical project should require. Behind the scenes,
  50. * all calls to this fluent API will update the above config.
  51. */
  52. let Api = require('./Api');
  53. let api = new Api();
  54. module.exports = api;
  55. module.exports.config = Config;