Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.1k views
in Technique[技术] by (71.8m points)

请问没用任何打包或者构建工具开发的项目如何压缩代码?

如题,一个开发好的项目没用任何构建工具,就只有压缩css和js的需求该怎么实现?
另外,如果用一些工具,比如webpack重新构建,是不是会很麻烦,要花很多的时间(项目是移动端)?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

压缩,代码混淆,肯定是离不开编译工具的,webpack是为更好的解决模块之间相互依赖关系而产生的工具,你这个完全没必要用webpack。只是压缩的话用gulp或者grunt就行,入门简单,项目文件不需要变动,只需把构建文件配置好,执行一下就行。
grunt:https://www.gruntjs.net/api/g...
gulp:https://www.gulpjs.com.cn/doc...


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...