Skip to content
This repository was archived by the owner on Mar 12, 2023. It is now read-only.

Commit 33fb72b

Browse files
authored
Merge pull request #94 from olback/3.3.0
3.3.0
2 parents 4fdb4e1 + 03a45cb commit 33fb72b

11 files changed

+270
-79
lines changed

CHANGELOG.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
# 3.2.0
1+
# 3.3.0
2+
* Added ability to minify file from explorer (file list to the left). Fixes #90.
3+
* Fixed issue #92. (Thanks @Tim-Veestraeten)
4+
* Added file watcher for config files.
5+
* Fixed #93.
6+
7+
## 3.2.0
28
* Added language and auto-complete support for `.autoprefixerrc`, `.cleancssrc`, `.uglifyrc` and `.terserrc`.
39
* Added `Minify: Export Configuration` command.
410

package.json

+55-11
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "es6-css-minify",
33
"displayName": "JS & CSS Minifier (Minify)",
44
"description": "Easily Minify ES5/ES6/ES7/ES8 and CSS. Supports minify on save, minify selection & custom configurations!",
5-
"version": "3.2.0",
5+
"version": "3.3.0",
66
"publisher": "olback",
77
"icon": "icon.png",
88
"galleryBanner": {
@@ -12,7 +12,7 @@
1212
"license": "SEE LICENSE IN LICENSE.md",
1313
"homepage": "https://github.com/olback/es6-css-minify",
1414
"bugs": "https://github.com/olback/es6-css-minify/issues",
15-
"qna": "https://github.com/olback/es6-css-minify/issues",
15+
"qna": "https://github.com/olback/es6-css-minify/issues/new?template=question.md",
1616
"repository": {
1717
"type": "git",
1818
"url": "https://github.com/olback/es6-css-minify.git"
@@ -38,6 +38,7 @@
3838
"onCommand:es6-css-minify.loadConfig",
3939
"onCommand:es6-css-minify.minify",
4040
"onCommand:es6-css-minify.minifySelection",
41+
"onCommand:es6-css-minify.minifyExplorer",
4142
"onCommand:es6-css-minify.exportConfig",
4243
"onLanguage:css",
4344
"onLanguage:javascript",
@@ -95,6 +96,10 @@
9596
"command": "es6-css-minify.minifySelection",
9697
"title": "Minify: Selection"
9798
},
99+
{
100+
"command": "es6-css-minify.minifyExplorer",
101+
"title": "Minify: File"
102+
},
98103
{
99104
"command": "es6-css-minify.exportConfig",
100105
"title": "Minify: Export Configuration"
@@ -145,9 +150,13 @@
145150
"default": ".uglifyrc"
146151
},
147152
"es6-css-minify.genJSmap": {
148-
"type": "boolean",
149-
"description": "Generate JavaScript sourcemap files.",
150-
"default": false
153+
"description": "Generate JavaScript sourcemap files. Setting this to null will give control to js.sourceMap.",
154+
"default": false,
155+
"enum": [
156+
true,
157+
false,
158+
null
159+
]
151160
},
152161
"es6-css-minify.jsMapSource": {
153162
"type": "string",
@@ -166,15 +175,16 @@
166175
},
167176
"es6-css-minify.js": {
168177
"type": "object",
169-
"description": "Uglify-es settings. For more info visit https://www.npmjs.com/package/uglify-es#parse-options.",
178+
"description": "Terser/Uglify-es settings. For more info visit https://www.npmjs.com/package/terser#minify-options.",
170179
"default": {
171180
"mangle": false,
172181
"compress": {
173182
"unused": false
174183
},
175184
"output": {
176185
"quote_style": 0
177-
}
186+
},
187+
"warnings": true
178188
}
179189
},
180190
"es6-css-minify.cleancssConfigFile": {
@@ -183,9 +193,13 @@
183193
"default": ".cleancssrc"
184194
},
185195
"es6-css-minify.genCSSmap": {
186-
"type": "boolean",
187-
"description": "Generate CSS sourcemap files.",
188-
"default": false
196+
"description": "Generate CSS sourcemap files. Setting this to null will give control to css.sourceMap.",
197+
"default": false,
198+
"enum": [
199+
true,
200+
false,
201+
null
202+
]
189203
},
190204
"es6-css-minify.cssMapSource": {
191205
"type": "string",
@@ -205,6 +219,13 @@
205219
"es6-css-minify.css": {
206220
"type": "object",
207221
"description": "Clean-CSS settings. For more info visit https://www.npmjs.com/package/clean-css.",
222+
"properties": {
223+
"rebase": {
224+
"description": "",
225+
"type": "boolean",
226+
"default": false
227+
}
228+
},
208229
"default": {
209230
"rebase": false
210231
}
@@ -235,7 +256,30 @@
235256
"editor/context": [
236257
{
237258
"command": "es6-css-minify.minify",
238-
"group": "es6-css-minify"
259+
"group": "es6-css-minify",
260+
"when": "editorLangId == javascript || editorLangId == css"
261+
},
262+
{
263+
"command": "es6-css-minify.minifySelection",
264+
"group": "es6-css-minify",
265+
"when": "editorLangId == javascript && editorHasSelection"
266+
},
267+
{
268+
"command": "es6-css-minify.minifySelection",
269+
"group": "es6-css-minify",
270+
"when": "editorLangId == css && editorHasSelection"
271+
},
272+
{
273+
"command": "es6-css-minify.minifySelection",
274+
"group": "es6-css-minify",
275+
"when": "editorLangId == json && editorHasSelection"
276+
}
277+
],
278+
"explorer/context": [
279+
{
280+
"command": "es6-css-minify.minifyExplorer",
281+
"group": "es6-css-minify",
282+
"when": "resourceLangId == javascript || resourceLangId == css"
239283
}
240284
]
241285
}

schemas/cleancssrc.schema.json

+5
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,11 @@
595595
"description": "Controls embedding sources inside a source map's sourcesContent field.",
596596
"type": "boolean",
597597
"default": false
598+
},
599+
"sourceMap": {
600+
"description": "Controls whether an output source map is built.",
601+
"type": "boolean",
602+
"default": false
598603
}
599604
}
600605
}

schemas/terserrc.schema.json

+31
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,37 @@
664664
]
665665
}
666666
]
667+
},
668+
"sourceMap": {
669+
"description": "Source map options",
670+
"default": false,
671+
"oneOf": [
672+
{
673+
"type": "object",
674+
"properties": {
675+
"includeSources": {
676+
"description": "Inlude source in source map.",
677+
"type": "boolean",
678+
"default": false
679+
},
680+
"root": {
681+
"description": "",
682+
"type": "string"
683+
},
684+
"url": {
685+
"description": "",
686+
"type": "string",
687+
"enum": [
688+
"inline"
689+
]
690+
}
691+
}
692+
},
693+
{
694+
"type": "boolean"
695+
}
696+
]
697+
667698
}
668699
}
669700
}

src/config.ts

+8-4
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ class Config {
1616

1717
// Terser
1818
uglifyConfigFile: string;
19-
genJSmap: boolean;
19+
genJSmap: boolean | null;
2020
jsMapSource: string;
2121
jsMinPath: string;
2222
jsPostfix: string;
2323
js: terser.MinifyOptions;
2424

2525
// Clean-css
2626
cleancssConfigFile: string;
27-
genCSSmap: boolean;
27+
genCSSmap: boolean | null;
2828
cssMapSource: string;
2929
cssMinPath: string;
3030
cssPostfix: string;
@@ -114,10 +114,14 @@ class Config {
114114
}
115115

116116
// Overwrite css.sourceMap with genCSSmap.
117-
this.css.sourceMap = this.genCSSmap;
117+
if (this.genCSSmap !== null) {
118+
this.css.sourceMap = this.genCSSmap;
119+
}
118120

119121
// Overwrite js.sourceMap with genJSmap.
120-
this.js.sourceMap = this.genJSmap;
122+
if (this.genJSmap !== null) {
123+
this.js.sourceMap = this.genJSmap;
124+
}
121125

122126
// RegEx
123127
// This should no longer be needed since terser accepts strings as well as RegExp. Issue #57

0 commit comments

Comments
 (0)