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.

52 lines
2.7 KiB

4 years ago
  1. let mix = require('laravel-mix');
  2. /*
  3. |--------------------------------------------------------------------------
  4. | Mix Asset Management
  5. |--------------------------------------------------------------------------
  6. |
  7. | Mix provides a clean, fluent API for defining some Webpack build steps
  8. | for your Laravel application. By default, we are compiling the Sass
  9. | file for your application, as well as bundling up your JS files.
  10. |
  11. */
  12. mix.js('src/app.js', 'dist/').sass('src/app.scss', 'dist/');
  13. // Full API
  14. // mix.js(src, output);
  15. // mix.react(src, output); <-- Identical to mix.js(), but registers React Babel compilation.
  16. // mix.preact(src, output); <-- Identical to mix.js(), but registers Preact compilation.
  17. // mix.coffee(src, output); <-- Identical to mix.js(), but registers CoffeeScript compilation.
  18. // mix.ts(src, output); <-- TypeScript support. Requires tsconfig.json to exist in the same folder as webpack.mix.js
  19. // mix.extract(vendorLibs);
  20. // mix.sass(src, output);
  21. // mix.less(src, output);
  22. // mix.stylus(src, output);
  23. // mix.postCss(src, output, [require('postcss-some-plugin')()]);
  24. // mix.browserSync('my-site.test');
  25. // mix.combine(files, destination);
  26. // mix.babel(files, destination); <-- Identical to mix.combine(), but also includes Babel compilation.
  27. // mix.copy(from, to);
  28. // mix.copyDirectory(fromDir, toDir);
  29. // mix.minify(file);
  30. // mix.sourceMaps(); // Enable sourcemaps
  31. // mix.version(); // Enable versioning.
  32. // mix.disableNotifications();
  33. // mix.setPublicPath('path/to/public');
  34. // mix.setResourceRoot('prefix/for/resource/locators');
  35. // mix.autoload({}); <-- Will be passed to Webpack's ProvidePlugin.
  36. // mix.webpackConfig({}); <-- Override webpack.config.js, without editing the file directly.
  37. // mix.babelConfig({}); <-- Merge extra Babel configuration (plugins, etc.) with Mix's default.
  38. // mix.then(function () {}) <-- Will be triggered each time Webpack finishes building.
  39. // mix.override(function (webpackConfig) {}) <-- Will be triggered once the webpack config object has been fully generated by Mix.
  40. // mix.dump(); <-- Dump the generated webpack config object to the console.
  41. // mix.extend(name, handler) <-- Extend Mix's API with your own components.
  42. // mix.options({
  43. // extractVueStyles: false, // Extract .vue component styling to file, rather than inline.
  44. // globalVueStyles: file, // Variables file to be imported in every component.
  45. // processCssUrls: true, // Process/optimize relative stylesheet url()'s. Set to false, if you don't want them touched.
  46. // purifyCss: false, // Remove unused CSS selectors.
  47. // terser: {}, // Terser-specific options. https://github.com/webpack-contrib/terser-webpack-plugin#options
  48. // postCss: [] // Post-CSS options: https://github.com/postcss/postcss/blob/master/docs/plugins.md
  49. // });