webpack.mix.js 2.8 KB

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