[0.11.4] CSS Comments are not removed
See original GitHub issueNode: 6.10.3 NPM: 4.5.0 OS: Ubuntu 16.04 cleancss: 4.0.12
Fresh laravel 5.4 app followed by npm install. Added cleanCss options to webpack.mix.js
const { mix } = require('laravel-mix');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
|
*/
mix.options({
cleanCss: {
level: {
1: { specialComments: 'none'}
}
},
purifyCss: true,
});
mix.js('resources/assets/js/app.js', 'public/js')
.sass('resources/assets/sass/app.scss', 'public/css');
npm run prod
results in a minified app.css file but comments are not removed:
charset "UTF-8";@import url(https://fonts.googleapis.com/css?family=Raleway:300,400,600);/*!
* Bootstrap v3.3.7 (http://getbootstrap.com)
* Copyright 2011-2016 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;font-size:10px;-webkit-tap-highlight-color:transparent}[hidden],template{display:none} ....
Running cleancss cli results in a file without comments: cleancss -O1 specialComments:none app.css > clean.css
@charset "UTF-8";@import url(https://fonts.googleapis.com/css?family=Raleway:300,400,600);html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;font-size:10px;-webkit-tap-highlight-color:transparent}[hidden],template{display:none} ...
Cheers
Issue Analytics
- State:
- Created 6 years ago
- Comments:15 (1 by maintainers)
Top Results From Across the Web
[0.11.4] CSS Comments are not removed · Issue #776 - GitHub
npm run prod results in a minified app.css file but comments are not removed: charset "UTF-8";@import url(https://fonts.googleapis.com/css ...
Read more >Comments - CSS: Cascading Style Sheets - MDN Web Docs
A CSS comment is used to add explanatory notes to the code or to prevent the browser from interpreting specific parts of the...
Read more >Comments in CSS - CSS-Tricks
In this case, this comment lets someone reading the CSS file know that that particular line of CSS was intended to allow for...
Read more >Angular Update Guide
We are deprecating support for @angular/platform-webworker , as it has been incompatible with the CLI. Running Angular's rendering architecture in a web ...
Read more >Changes 0.11.x - web2ldap
Removed invalid note about NON-ASCII chars not allowed in LDIF input form. Display allowed URL schemes as note near LDIF input form.
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
@marcelogarbin
Yes.
Tweaked webpack.mix.js
style.css output
Try to delete your node_modules folder and install packages again (npm install)
Also I am not able to remove the comments, however using the “postcss-discard-comments” plugin, I can remove the comments from my SASS file, the same configuration does not work for mix.stylus.
Did you find any alternatives?
my configs.: mix.sass()
and mix.styles()