vscode壓縮js代碼的方法-創(chuàng)新互聯(lián)

這篇文章主要介紹vscode壓縮js代碼的方法,文中介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們一定要看完!

創(chuàng)新互聯(lián)主要從事網(wǎng)頁設(shè)計、PC網(wǎng)站建設(shè)(電腦版網(wǎng)站建設(shè))、wap網(wǎng)站建設(shè)(手機(jī)版網(wǎng)站建設(shè))、成都響應(yīng)式網(wǎng)站建設(shè)、程序開發(fā)、網(wǎng)站優(yōu)化、微網(wǎng)站、微信小程序開發(fā)等,憑借多年來在互聯(lián)網(wǎng)的打拼,我們在互聯(lián)網(wǎng)網(wǎng)站建設(shè)行業(yè)積累了豐富的網(wǎng)站設(shè)計制作、成都網(wǎng)站設(shè)計、網(wǎng)站設(shè)計、網(wǎng)絡(luò)營銷經(jīng)驗,集策劃、開發(fā)、設(shè)計、營銷、管理等多方位專業(yè)化運作于一體。

vscode壓縮js代碼的方法:

1、在拓展商店里搜索“minify”,安裝,安裝成功后點重新加載

2、使用:F1運行文件縮小器Minify壓縮js代碼。

使用Minify的方法介紹:

縮小您的js,css和html文件以節(jié)省傳輸帶寬。直接調(diào)用每個縮小器,以允許傳遞設(shè)置:

JS: uglify -js v2.7.4

CSS: clean-css v3.4.21

HTML: html-minifier v3.2.2

使用F1 運行文件縮小器Minify。

包含Javascript和CSS文件的文件夾可以{dirname}.min.[css|js]使用F1 縮小為一個文件Minify Directory。可以為Javascript和CSS減少一個目錄是可以接受的。

(可選)在已存在匹配的縮小文件(和/或目錄)時,在保存時運行minify。啟用您的用戶或工作空間設(shè)置。設(shè)置默認(rèn)值如下所示:

"minify.minifyExistingOnSave": false,"minify.js": {
	"mangle": true,
	"compress": {
		"sequences": true,
		"properties": true,
		"dead_code": true,
		"drop_debugger": true,
		"unsafe": false,
		"unsafe_comps": false,
		"conditionals": true,
		"comparisons": true,
		"evaluate": true,
		"booleans": true,
		"loops": true,
		"unused": true,
		"hoist_funs": true,
		"keep_fargs": true,
		"keep_fnames": false,
		"hoist_vars": false,
		"if_return": true,
		"join_vars": true,
		"collapse_vars": false,
		"reduce_vars": false,
		"side_effects": true,
		"pure_getters": false,
		"pure_funcs": null,
		"negate_iife": false,
		"drop_console": false,
		"passes": 1,
		"global_defs": {}
	},
	"output": {
		"ascii_only": false,
		"inline_script": false,
		"max_line_len": 32000,
		"braces": false,
		"semicolons": true,
		"comments": false,
		"shebang": true,
		"preamble": null,
		"quote_style": "best"
	}},"minify.css": {
	"advanced": true,
	"aggressiveMerging": true,
	"compatibility": "*",
	"inliner": {},
	"keepBreaks": false,
	"keepSpecialComments": "*",
	"mediaMerging": true,
	"processImport": true,
	"processImportFrom": ["all"],
	"rebase": true,
	"restructuring": true,
	"root": "${workspaceRoot}",
	"roundingPrecision": 2,
	"semanticMerging": false,
	"shorthandCompacting": true},"minify.html": {
	"caseSensitive": false,
	"collapseBooleanAttributes": true,
	"collapseWhitespace": true,
	"conservativeCollapse": false,
	"customAttrAssign": [],
	"customAttrCollapse": "",
	"customAttrSurround": [],
	"customEventAttributes": [ "^on[a-z]{3,}$" ],
	"decodeEntities": false,
	"html5": true,
	"ignoreCustomComments": [ "^!" ],
	"ignoreCustomFragments": ["<%[\\s\\S]*?%>", "<\\?[\\s\\S]*?\\?>"],
	"includeAutoGeneratedTags": true,
	"keepClosingSlash": false,
	"maxLineLength": false,
	"minifyCSS": true, //uses minify.css settings if true
	"minifyJS": true, //uses minify.js settings if true
	"minifyURLs": false,
	"preserveLineBreaks": false,
	"preventAttributesEscaping": false,
	"processConditionalComments": false,
	"processScripts": [],
	"quoteCharacter": "\"",
	"removeAttributeQuotes": false,
	"removeComments": false,
	"removeEmptyAttributes": false,
	"removeEmptyElements": false,
	"removeOptionalTags": false,
	"removeRedundantAttributes": false,
	"removeScriptTypeAttributes": false,
	"removeStyleLinkTypeAttributes": false,
	"sortAttributes": false,
	"sortClassName": false,
	"useShortDoctype": false}

minifiy.css.root接受“ ${workspaceRoot}/ some / path”定義內(nèi)部@import絕對根。

由于html-minifier還采用了clean-css和uglify-js,設(shè)置minifyJS或minifyCSS以true意志嵌入你為那些minifiers自動提供的設(shè)置。如果要使用一些其他方法,可以提供自己的設(shè)置作為對象。

以上是“vscode壓縮js代碼的方法”這篇文章的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對大家有幫助,更多相關(guān)知識,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!

新聞名稱:vscode壓縮js代碼的方法-創(chuàng)新互聯(lián)
轉(zhuǎn)載來源:http://www.muchs.cn/article0/ipgio.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供定制開發(fā)自適應(yīng)網(wǎng)站虛擬主機(jī)移動網(wǎng)站建設(shè)、網(wǎng)站營銷、外貿(mào)網(wǎng)站建設(shè)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

外貿(mào)網(wǎng)站制作