prettier-webpack-plugin | Process your Webpack dependencies with Prettier | Plugin library
kandi X-RAY | prettier-webpack-plugin Summary
kandi X-RAY | prettier-webpack-plugin Summary
Automatically process your source files with Prettier when bundling via Webpack.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of prettier-webpack-plugin
prettier-webpack-plugin Key Features
prettier-webpack-plugin Examples and Code Snippets
Community Discussions
Trending Discussions on prettier-webpack-plugin
QUESTION
For my specific project, I need to control the minification of my CSS and only minify certain files. I am very close to a working solution using OptimizeCSSAssetsPlugin
where I use the assetNameRegExp
option to choose the CSS files I want to minify.
I have spent a while now trying to figure out why all my other CSS files are still being minified. It turns out that sass-loader
will always minify your CSS when in production mode whether you want it to or not.
Here is my full webpack.config.js
.
ANSWER
Answered 2019-Sep-12 at 09:58I finally figured out my issue and wanted to post the answer so if anyone else in the future comes across this issue they can solve it.
Despite what my question says, to start with I actually didn't know which loader was causing the issue, after doing some research I initially thought css-loader
was the culprit. I did some digging into the code and found that there is no minification in css-loader
. The next loader to look into was sass-loader
, after lots of research I eventually figured out sass-loader
was doing the minification. Looking into the sass-loader
docs I didn't seem to find any information about minification or how to stop it. After lots of googling, I eventually found the very poorly documented option outputStyle
.
From what I can find outputStyle takes 3 options:
QUESTION
I'm trying to have my scss run through prettier but always get errors. I'm using the prettier-webpack-loader
(also tried with prettier-webpack-plugin
). When I run it, it seems to want to process the .scss files as javascript. One of my js files looks like this:
ANSWER
Answered 2017-Dec-11 at 18:39It looks like prettier-webpack-loader does not pass the file path to Prettier, so there's no way for it to know it should parse as a SCSS file.
I think if you separate the loaders and add the parser to the options it might work:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install prettier-webpack-plugin
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page