laravel-mix: .options({processCssUrl: false}) causes .sourceMaps() malfunctioning
- Laravel Mix Version: 5.4.15
- Node Version (
node -v): 7.6.0 - NPM Version (
npm -v): 4.1.2 - OS: 10.12.3
- laravel-mix: 0.8.8
Description:
When use .sourceMaps() alone in my webpack.mix.js, the source map works fine for Sass compiling. With a fresh installation of Laravel, the generated css file is 1.61 MB. However, if options({processCssUrl: false}) is added, the css file is only 146KB, not minified, and no source map found by the browser. The source map part of the file is as this.
/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiIvY3NzL2FwcC5jc3MiLCJzb3VyY2VSb290IjoiIn0=*/
Steps To Reproduce:
laravel new laravel_projcd laravel_projnpm install- open
composer.json - revise all
bin/cross-env.jstodist/bin/cross-env.js(this is a fix found here for another error) - revise
"laravel-mix": "^0.8.1"to"laravel-mix": "^0.8.8", as suggested by @gudorian to eleminate error message on.options npm i- open
webpack.mix.js - revise to
mix.sass('resources/assets/app/app.scss', 'public/css')
.options({
processCssUrls: false
});
mix.sourceMaps()
npm run dev- result
Asset Size Chunks Chunk Names
/css/app.css 146 kB 0 [emitted] /js/app
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 3
- Comments: 16 (7 by maintainers)
I’m having the same issue, but for me it doesn’t matter what I put
processCssUrlsto. I want it set to false, I tried setting it to “true”, but it didn’t make a difference.I also tried using the master branch, just to see if I should pitch in I’m having the same issue, or if I should simply wait for next release.
After removing the node_modules directory and reinstalling with laravel-mix pointing to this git-repo, I still got an empty sass-sourcemap.
Laravel mix v0.10.0 I have tried both
.sass()and the new.standaloneSass()method ..sass()method behavior remain same..standaloneSass()method does generate inline sourcemap.Don’t use master. Just wait a day or so until we’ve tagged it.
This was fixed last week. We just haven’t tagged it yet. Will do soon. Thx.