Commit 4e20daba authored by Philipp Nowinski's avatar Philipp Nowinski
Browse files

[FEATURE] add minification

parent 5b216a78
......@@ -10,6 +10,7 @@ const chalk = require('chalk');
const stylelint = require('stylelint');
const reporter = require('postcss-reporter');
const scss = require('postcss-scss');
const postcssClean = require('postcss-clean');
const postcssSass = require('@csstools/postcss-sass');
const browserSync = require('browser-sync');
const InlineSvg = require('@sgalinski/inline-svg');
......@@ -112,7 +113,8 @@ module.exports = class Css extends Task {
let cssString = this._imageDimensions(compiledSass.css.toString());
let postProcessedCss = await postcss([
autoprefixer
autoprefixer,
postcssClean
]).process(cssString, {
from: _input,
to: _output,
......
......@@ -5,6 +5,7 @@ const chalk = require('chalk');
const globby = require('globby');
const browserify = require('browserify');
const babelify = require('babelify');
const uglifyify = require('uglifyify');
const CLIEngine = require("eslint").CLIEngine;
const exorcist = require('exorcist');
const browserSync = require('browser-sync');
......@@ -107,6 +108,7 @@ module.exports = class Js extends Task {
[require('@babel/preset-env'), presetEnvConfiguration],
]
})
.transform(uglifyify)
.bundle()
.pipe(exorcist(
this._getSourceMapsPath(_output),
......
......@@ -3166,6 +3166,21 @@
}
}
},
"clean-css": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.1.tgz",
"integrity": "sha512-4ZxI6dy4lrY6FHzfiy1aEOXgu4LIsW2MhwG0VBKdcoGoH/XLFgaHSdLTGr4O8Be6A8r3MOphEiI8Gc1n0ecf3g==",
"requires": {
"source-map": "~0.6.0"
},
"dependencies": {
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="
}
}
},
"cli-cursor": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz",
......@@ -9332,6 +9347,32 @@
}
}
},
"postcss-clean": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/postcss-clean/-/postcss-clean-1.1.0.tgz",
"integrity": "sha512-83g3GqMbCM5NL6MlbbPLJ/m2NrUepBF44MoDk4Gt04QGXeXKh9+ilQa0DzLnYnvqYHQCw83nckuEzBFr2muwbg==",
"requires": {
"clean-css": "^4.x",
"postcss": "^6.x"
},
"dependencies": {
"postcss": {
"version": "6.0.23",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz",
"integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==",
"requires": {
"chalk": "^2.4.1",
"source-map": "^0.6.1",
"supports-color": "^5.4.0"
}
},
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="
}
}
},
"postcss-html": {
"version": "0.33.0",
"resolved": "https://registry.npmjs.org/postcss-html/-/postcss-html-0.33.0.tgz",
......@@ -10647,6 +10688,22 @@
"urix": "^0.1.0"
}
},
"source-map-support": {
"version": "0.5.9",
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.9.tgz",
"integrity": "sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA==",
"requires": {
"buffer-from": "^1.0.0",
"source-map": "^0.6.0"
},
"dependencies": {
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="
}
}
},
"source-map-url": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz",
......@@ -13653,6 +13710,23 @@
"uuid": "^3.0.1"
}
},
"terser": {
"version": "3.8.2",
"resolved": "https://registry.npmjs.org/terser/-/terser-3.8.2.tgz",
"integrity": "sha512-FGSBXiBJe2TSXy6pWwXpY0YcEWEK35UKL64BBbxX3aHqM4Nj0RMqXvqBuoSGfyd80t8MKQ5JwYm5jRRGTSEFNg==",
"requires": {
"commander": "~2.17.1",
"source-map": "~0.6.1",
"source-map-support": "~0.5.6"
},
"dependencies": {
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="
}
}
},
"text-table": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
......@@ -13955,6 +14029,30 @@
"resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.17.tgz",
"integrity": "sha512-uRdSdu1oA1rncCQL7sCj8vSyZkgtL7faaw9Tc9rZ3mGgraQ7+Pdx7w5mnOSF3gw9ZNG6oc+KXfkon3bKuROm0g=="
},
"uglifyify": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/uglifyify/-/uglifyify-5.0.1.tgz",
"integrity": "sha512-PO44rgExvwj3rkK0UzenHVnPU18drBy9x9HOUmgkuRh6K2KIsDqrB5LqxGtjybgGTOS1JeP8SBc+TN5rhiva6w==",
"requires": {
"convert-source-map": "~1.1.0",
"extend": "^1.2.1",
"minimatch": "^3.0.2",
"terser": "^3.7.5",
"through": "~2.3.4"
},
"dependencies": {
"convert-source-map": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz",
"integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA="
},
"extend": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/extend/-/extend-1.3.0.tgz",
"integrity": "sha1-0VFvsP9WJNLr+RI+odrFoZlABPg="
}
}
},
"ultron": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment