Three bugs found during task 20 verify, all fixed: 1. Tailwind CLI does NOT read postcss.config.js. Switched Dockerfile to npx postcss + postcss-cli so the postcss plugin chain actually runs. 2. postcss-import was not installed but app.css uses @import for the primitive component files. Added postcss-import + cssnano (for prod minification under --env production). 3. @import statements must come BEFORE any other rules per CSS spec. app.css had @tailwind base/components ABOVE @import, so postcss-import silently skipped every component @import. Moved all @imports to the top, @tailwind directives below. Bundle went from 121KB with 0 wd-* classes to 138KB with 116 wd-* classes. Also added tailwind safelist for wd-/is-/nav-dev-badge so the wave-2 migration of HTML files cannot accidentally tree-shake primitives.
8 lines
197 B
JavaScript
8 lines
197 B
JavaScript
module.exports = ({ env }) => ({
|
|
plugins: {
|
|
'postcss-import': {},
|
|
tailwindcss: {},
|
|
autoprefixer: {},
|
|
...(env === 'production' ? { cssnano: { preset: 'default' } } : {}),
|
|
},
|
|
});
|