ishanvyas22 / asset-mix

Provides helpers functions for CakePHP to use Laravel Mix.
MIT License
33 stars 12 forks source link

ERROR in multi ./assets/js/app.js ./assets/sass/app.sass Module not found: Error: Can't resolve #14

Closed ishanvyas22 closed 4 years ago

ishanvyas22 commented 4 years ago

For custom directories (other than assets), webpack.mix.js file's content generates invalid result on npm run dev command.

Current webpack.mix.js file content:

const mix = require('laravel-mix');

mix.setPublicPath('./webroot')
  .js('assets/js/app.js', 'webroot/js')
  .sass('assets/sass/app.sass', 'webroot/css')
  .version();

It should be:

const mix = require('laravel-mix');

mix.setPublicPath('./webroot')
  .js('resources/js/app.js', 'webroot/js')
  .sass('resources/sass/app.sass', 'webroot/css')
  .version();

Or whatever user has entered while generating custom directories