aitor
August 18, 2021, 3:15pm
1
After yarn build:production
it works as expected.
After yarn build
and yarn start
there is no souce maps at public/styles
webpack.mix.js
has the souceMaps
function at the end of the file:
mix
.sourceMaps()
.version();
What else do I have to look at? Thanks!
It can well be that the sourcemap is writting inline into the output CSS file.
Does it work in the browser developer tools? Does it show the original source (SCSS) files and line numbers when inspecting styles?
1 Like
aitor
August 18, 2021, 3:52pm
3
It doesn’t work and it doesn’t show the source files when inspect files. All styles are shown as it belongs to app.css?id=randomhash
.
Also, Chrome has enabled CSS source maps.
Hm, this appears to be a bug with laravel-mix
or of the webpack dependencies:
opened 03:39PM - 18 Oct 18 UTC
closed 11:53PM - 06 Mar 20 UTC
Laravel Mix Version: 2.1.14
Node Version (node -v): 10.12.0
NPM Version (npm -v): 6.4.1
OS: macOS
Description:
Following the documentation here: https://laravel.com/docs/5.7/mix#css-source-maps
mix.sourceMaps() doesn't work. It's not...
stale
Does some of these workaround help (especially those at the end)?
Also this thread:
https://laracasts.com/discuss/channels/elixir/laravel-mix-sourcemap-files-not-genarates
1 Like
aitor
August 18, 2021, 3:56pm
5
wow! a bug from 2018?
reading workarounds
aitor
August 18, 2021, 4:18pm
6
Solved adding this to css block:
// webpack.mix.js
.webpackConfig({
devtool: 'source-map'
})
So, the entire block is:
mix
.sass('resources/styles/app.scss', 'styles')
.sass('resources/styles/editor.scss', 'styles')
.webpackConfig({
devtool: 'source-map'
})
.options({
processCssUrls: false,
postCss:[require('tailwindcss')],
});
2 Likes
system
Closed
September 29, 2021, 3:15pm
7
This topic was automatically closed after 42 days. New replies are no longer allowed.