webpack.mix.js 826 B

123456789101112131415161718192021222324252627282930
  1. const 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 the application as well as bundling up all the JS files.
  10. |
  11. */
  12. //复制资源
  13. mix.copy('resources/assets/statics/public', 'public');
  14. //生成vue页面js
  15. mix.js('resources/assets/js/main/main.js', 'js/main.js');
  16. //生成css样式文件
  17. mix.sass('resources/assets/sass/app.scss', 'css');
  18. //配置webpack
  19. mix.webpackConfig({
  20. output: {
  21. hashDigestLength: 32,
  22. chunkFilename: 'js/build/[name].js?[hash]',
  23. }
  24. });