Skip to content

Enabling JIT breaks sourcemaps in webpack + PostCSS project #5043

@evenfrost

Description

@evenfrost

What 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:
Screenshot from 2021-07-22 16-36-57

When disabling the JIT option:

  purge: false,

Source maps are being processed properly, and the original file is shown in Chrome DevTools:
Screenshot from 2021-07-22 16-30-51

I'll bootstrap a repro repo if a more thorough investigation is needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions