Enabling JIT breaks sourcemaps in webpack + PostCSS project
See original GitHub issueWhat version of Tailwind CSS are you using?
2.2.6
What build tool (or framework if it abstracts the build tool) are you using?
webpack 5.46.0, postcss 8.3.6
What version of Node.js are you using?
14.17.0
What browser are you using?
Chrome
What operating system are you using?
Ubuntu
Reproduction repository
⠀
Describe your issue
When using Tailwind’s JIT option for processing PostCSS in the webpack project, source maps are not being shown in the Chrome DevTools (but still generated in the output CSS file). The value of devtool
option in the webpack config doesn’t matter, the result is the same.
With config like this:
purge: [
'./src/**/*.tsx',
],
mode: 'jit',
Source maps don’t get processed:
When disabling the JIT option:
purge: false,
Source maps are being processed properly, and the original file is shown in Chrome DevTools:
I’ll bootstrap a repro repo if a more thorough investigation is needed.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:7 (1 by maintainers)
Top Results From Across the Web
postcss-loader | webpack - JS.ORG
By default generation of source maps depends on the devtool option. All values enable source map generation except eval and false value. webpack.config.js...
Read more >Speeding Up Tailwind CSS Builds - nystudio107
Learn how to optimize your Tailwind CSS PostCSS build times to make local development with Hot Module Replacement or Live Reload orders of ......
Read more >webpack shows incorrect sourcemaps when using tailwibd ...
I'm using TailwindCSS 2.1+ in mode: 'jit' with SCSS, and currently facing the issue. Let say I created class .red .red { color:...
Read more >How to Use Tailwind on a Svelte Site | CSS-Tricks
Let's spin up a basic Svelte site and integrate Tailwind into it for styling. One advantage of working with Tailwind is that there...
Read more >Why we switched from Webpack to Vite - Hacker News
We adopted Vite early on for a large Vue project. ... You enable sourcemaps on Webpack with `devtool = "eval-source-map"` in your config, ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Source maps are also not working properly in 3.0.19.
src/css/app.css
src/js/app.js
webpack.config.js
The generated
public/dist/app.css.map
includes this section:Using Chrome DevTools all the Tailwind CSS rules show as
<no source>:1
Adding any regular css rule or even a simple comment will generate sourcemaps correctly.