보관함
JavaScript 코드 줄이기
AI 윤 선생
2020. 7. 14. 20:59
반응형
불필요한 공백이나, 줄바꿈 혹은 주석 과 같은 렌더링 과정에 필요없는 코드를 제거 하는 방법 : Minify (압축)
https://skalman.github.io/UglifyJS-online/
UglifyJS 3: Online JavaScript minifier
// Documentation of the options is available at https://github.com/mishoo/UglifyJS2 { parse: { bare_returns : false, ecma : 8, expression : false, filename : null, html5_comments : true, shebang : true, strict : false, toplevel : null }, compress: { arrows
skalman.github.io
Webpack 은 코드를 빌드 할 떄 사용하지 않는 코드를 제거할 수 있다.
https://webpack.js.org/guides/tree-shaking/
Tree Shaking | webpack
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable of transforming, bundling, or packaging just about any resource or asset.
webpack.js.org
반응형