简体   繁体   English

使用 Webpack 和 Babel 时,关闭压缩的最佳方法是什么?

[英]When using Webpack and Babel, what is the best way to turn off compression?

I'm trying to get more familiar with webpack. It's my understanding that if I'm not including the uglify plugin, that dist/bundle.js shouldn't be minimized or compressed, but it seems like it is.我正在尝试更熟悉 webpack。据我了解,如果我不包括 uglify 插件,则不应最小化或压缩dist/bundle.js ,但它似乎是。

https://gist.github.com/dcvezzani/bb535a2236ef160b0769b86ec10e526b https://gist.github.com/dcvezzani/bb535a2236ef160b0769b86ec10e526b

I thought How to build minified and uncompressed bundle with webpack?我想How to build minified and uncompressed bundle with webpack? might help, but perhaps webpack has changed so that the answers there are not relevant anymore.可能会有所帮助,但也许 webpack 已更改,因此那里的答案不再相关。

Does webpack use its own compression? webpack 是否使用自己的压缩? For educational purposes, how would I run webpack so that I get my bundle, but the content is not compressed or minimized?出于教育目的,我将如何运行 webpack 以便获得我的包,但内容不会被压缩或最小化?

这个答案提到了module.exports.optimization.minimize中的webpack.config.js并将其设置为false帮助我从webpack获得了漂亮的捆绑包。

you may forget to set webpack.mode to "development"您可能忘记将 webpack.mode 设置为“开发”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM