Laravel-mix: Can't run mix.sass() with an array of files

Created on 13 Mar 2018  路  4Comments  路  Source: JeffreyWay/laravel-mix

  • Laravel Mix Version: 2.0.0
  • Node Version: 8.9.4
  • NPM Version: 5.6.0
  • OS: Windows 10

Description:

I can't run mix.standaloneSass() by passing in an array, only a single string for one file.
It throws the error AssertionError [ERR_ASSERTION]: Whoops, you are trying to compile css/scss_test/_entry.scss, but that file does not exist.

Not sure if related: I would much prefer to use mix.sass() to take advantage of PostCSS and Autoprefixer, but this throws a different error (even with a single string rather than an array): Error: Chunk.entrypoints: Use Chunks.groupsIterable and filter by instanceof Entrypoint instead

Can easily attach any relevant files on request, not sure what's relevant and don't want to clutter up the issue.

Steps To Reproduce:

  • New directory, no dependencies in package.json other than required.
  • Add a folder css, with subfolder scss_test
  • webpack.mix.js has only one line after import: mix.standaloneSass(['css/scss_vendor/_entry.scss'], 'comp.css'). Passing in the same source file as a string instead of an array works perfectly
  • Run npm run mix, which is set to cross-env NODE_ENV=development webpack --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js.
stale

Most helpful comment

Why isn't this a feature? There's plenty of issues here and on SO for this.

All 4 comments

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Why isn't this a feature? There's plenty of issues here and on SO for this.

The workaround is pretty simple: just have a root file that imports the others, and compile that file
Bonus: this allows you to specify the order that the files should be combined, because otherwise it would be effectively arbitrary.

@SamWoolerton In reality there are often .scss from multiple libraries, so it totally makes sense to pass an array (instead of importing them manually inside one file). Passing an array of .scss is absolute standard in frontend workflows, it's weird that mix does it differently.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wendt88 picture wendt88  路  3Comments

Cheddam picture Cheddam  路  3Comments

kpilard picture kpilard  路  3Comments

jpmurray picture jpmurray  路  3Comments

amin101 picture amin101  路  3Comments