Custom postcss plugins won't work in production build
See original GitHub issueHey,
I am trying to use postcss with tailwindcss plugin. It works for ng serve
and ng build
but when using ng build --prod
to build production assets, it doesnt run tailwindcss plugin. I added console log at start of custom webpack file, it shows in console but it just doesnt run tailwindcss plugin.
My custom webpack looks like this:
const tailwindcss = require('tailwindcss');
console.log('** Custom webpack config was loaded.');
module.exports = {
module: {
rules: [
{
test: /\.css$/,
use: [
{
"loader": "postcss-loader",
"options": {
"ident": "embedded",
"plugins": [
tailwindcss('./tailwind.js'),
],
"sourceMap": true
}
}
]
},
],
},
};
I have tried all mergeStrategies in angular.json configuration but it doesnt work anyway.
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Advanced Features: Customizing PostCSS Config - Next.js
Extend the PostCSS config and plugins added by Next.js with your own. ... To customize the PostCSS configuration, create a postcss.config.json file in...
Read more >[object Object] is not a PostCSS plugin. This happened when i ...
The app runs perfectly on the development. But when I tried to build it on production it shows me this error. I never...
Read more >PostCSS Plugin Guidelines
A PostCSS plugin is a function that receives and, usually, transforms a CSS AST from the PostCSS parser. The rules below are mandatory...
Read more >postcss/postcss - Gitter
Hi all I'm getting this error while using postcss-loader. ERROR in ./node_modules/ag-grid-community/dist/styles/ag-theme-fresh.css Module build failed (from ...
Read more >CSS - Parcel
If this was the only PostCSS plugin you used, you can remove your PostCSS config entirely. This can improve build performance significantly. You...
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 FreeTop 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
Top GitHub Comments
Ok, need to take a look at Angular internals. Probably they are disabling
postcss
plugin in production build or something.Setting
extractCss
tofalse
in angular.json file fixed this issue, extra webpack config is loaded and build is ok.