Skip to content
This repository was archived by the owner on Mar 12, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# 3.2.0
# 3.3.0
* Added ability to minify file from explorer (file list to the left). Fixes #90.
* Fixed issue #92. (Thanks @Tim-Veestraeten)
* Added file watcher for config files.
* Fixed #93.

## 3.2.0
* Added language and auto-complete support for `.autoprefixerrc`, `.cleancssrc`, `.uglifyrc` and `.terserrc`.
* Added `Minify: Export Configuration` command.

Expand Down
66 changes: 55 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "es6-css-minify",
"displayName": "JS & CSS Minifier (Minify)",
"description": "Easily Minify ES5/ES6/ES7/ES8 and CSS. Supports minify on save, minify selection & custom configurations!",
"version": "3.2.0",
"version": "3.3.0",
"publisher": "olback",
"icon": "icon.png",
"galleryBanner": {
Expand All @@ -12,7 +12,7 @@
"license": "SEE LICENSE IN LICENSE.md",
"homepage": "https://github.com/olback/es6-css-minify",
"bugs": "https://github.com/olback/es6-css-minify/issues",
"qna": "https://github.com/olback/es6-css-minify/issues",
"qna": "https://github.com/olback/es6-css-minify/issues/new?template=question.md",
"repository": {
"type": "git",
"url": "https://github.com/olback/es6-css-minify.git"
Expand All @@ -38,6 +38,7 @@
"onCommand:es6-css-minify.loadConfig",
"onCommand:es6-css-minify.minify",
"onCommand:es6-css-minify.minifySelection",
"onCommand:es6-css-minify.minifyExplorer",
"onCommand:es6-css-minify.exportConfig",
"onLanguage:css",
"onLanguage:javascript",
Expand Down Expand Up @@ -95,6 +96,10 @@
"command": "es6-css-minify.minifySelection",
"title": "Minify: Selection"
},
{
"command": "es6-css-minify.minifyExplorer",
"title": "Minify: File"
},
{
"command": "es6-css-minify.exportConfig",
"title": "Minify: Export Configuration"
Expand Down Expand Up @@ -145,9 +150,13 @@
"default": ".uglifyrc"
},
"es6-css-minify.genJSmap": {
"type": "boolean",
"description": "Generate JavaScript sourcemap files.",
"default": false
"description": "Generate JavaScript sourcemap files. Setting this to null will give control to js.sourceMap.",
"default": false,
"enum": [
true,
false,
null
]
},
"es6-css-minify.jsMapSource": {
"type": "string",
Expand All @@ -166,15 +175,16 @@
},
"es6-css-minify.js": {
"type": "object",
"description": "Uglify-es settings. For more info visit https://www.npmjs.com/package/uglify-es#parse-options.",
"description": "Terser/Uglify-es settings. For more info visit https://www.npmjs.com/package/terser#minify-options.",
"default": {
"mangle": false,
"compress": {
"unused": false
},
"output": {
"quote_style": 0
}
},
"warnings": true
}
},
"es6-css-minify.cleancssConfigFile": {
Expand All @@ -183,9 +193,13 @@
"default": ".cleancssrc"
},
"es6-css-minify.genCSSmap": {
"type": "boolean",
"description": "Generate CSS sourcemap files.",
"default": false
"description": "Generate CSS sourcemap files. Setting this to null will give control to css.sourceMap.",
"default": false,
"enum": [
true,
false,
null
]
},
"es6-css-minify.cssMapSource": {
"type": "string",
Expand All @@ -205,6 +219,13 @@
"es6-css-minify.css": {
"type": "object",
"description": "Clean-CSS settings. For more info visit https://www.npmjs.com/package/clean-css.",
"properties": {
"rebase": {
"description": "",
"type": "boolean",
"default": false
}
},
"default": {
"rebase": false
}
Expand Down Expand Up @@ -235,7 +256,30 @@
"editor/context": [
{
"command": "es6-css-minify.minify",
"group": "es6-css-minify"
"group": "es6-css-minify",
"when": "editorLangId == javascript || editorLangId == css"
},
{
"command": "es6-css-minify.minifySelection",
"group": "es6-css-minify",
"when": "editorLangId == javascript && editorHasSelection"
},
{
"command": "es6-css-minify.minifySelection",
"group": "es6-css-minify",
"when": "editorLangId == css && editorHasSelection"
},
{
"command": "es6-css-minify.minifySelection",
"group": "es6-css-minify",
"when": "editorLangId == json && editorHasSelection"
}
],
"explorer/context": [
{
"command": "es6-css-minify.minifyExplorer",
"group": "es6-css-minify",
"when": "resourceLangId == javascript || resourceLangId == css"
}
]
}
Expand Down
5 changes: 5 additions & 0 deletions schemas/cleancssrc.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,11 @@
"description": "Controls embedding sources inside a source map's sourcesContent field.",
"type": "boolean",
"default": false
},
"sourceMap": {
"description": "Controls whether an output source map is built.",
"type": "boolean",
"default": false
}
}
}
31 changes: 31 additions & 0 deletions schemas/terserrc.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,37 @@
]
}
]
},
"sourceMap": {
"description": "Source map options",
"default": false,
"oneOf": [
{
"type": "object",
"properties": {
"includeSources": {
"description": "Inlude source in source map.",
"type": "boolean",
"default": false
},
"root": {
"description": "",
"type": "string"
},
"url": {
"description": "",
"type": "string",
"enum": [
"inline"
]
}
}
},
{
"type": "boolean"
}
]

}
}
}
12 changes: 8 additions & 4 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ class Config {

// Terser
uglifyConfigFile: string;
genJSmap: boolean;
genJSmap: boolean | null;
jsMapSource: string;
jsMinPath: string;
jsPostfix: string;
js: terser.MinifyOptions;

// Clean-css
cleancssConfigFile: string;
genCSSmap: boolean;
genCSSmap: boolean | null;
cssMapSource: string;
cssMinPath: string;
cssPostfix: string;
Expand Down Expand Up @@ -114,10 +114,14 @@ class Config {
}

// Overwrite css.sourceMap with genCSSmap.
this.css.sourceMap = this.genCSSmap;
if (this.genCSSmap !== null) {
this.css.sourceMap = this.genCSSmap;
}

// Overwrite js.sourceMap with genJSmap.
this.js.sourceMap = this.genJSmap;
if (this.genJSmap !== null) {
this.js.sourceMap = this.genJSmap;
}

// RegEx
// This should no longer be needed since terser accepts strings as well as RegExp. Issue #57
Expand Down
Loading