webpack convert css unit with uglifyjs plugin -


it's weird, actually, think quite easy come across, have found nothing issue~

i have tested / without uglifyjs plugin, , i'm quite sure plugin results in issue.

in style files, px / em have been used, after compression, of px has been converted pc / pt, totally have no clue~

enter image description here

even though uglifyjs has js in name affects other loaders. answer hidden in uglifyjsplugin docs.

minimize javascript output of chunks. loaders switched minimizing mode. (...)

the discussion takes place here:

https://github.com/webpack/webpack/issues/283

no workaround yet see.

i long doesn't mess build, keep using uglifyjs. when starts, can try

  1. switching babili (babel based minifier) + babili-webpack-plugin.

    https://babeljs.io/blog/2016/08/30/babili

    https://www.npmjs.com/package/babili-webpack-plugin

    and minifying css css-loader minimize option.

from https://github.com/webpack/css-loader :

you can disable or enforce minification minimize query

parameter.  require("css-loader?minimize!./file.css") (enforced) require("css-loader?-minimize!./file.css") (disabled) 

or

  1. disabling minimize option in css-loader plugin (overwriting uglifyjs behavior). don't worry csses will minimized, bit less (in case). - better crashing production build.

i tried babili without success second option helped in production build of project.


Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -