0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-22 14:39:45 -05:00

feat(frontend): improve scss build for production

This commit is contained in:
Andrey Antukh 2019-07-02 20:04:15 +02:00
parent 5fdcae4196
commit 7c1168e797
3 changed files with 42 additions and 5 deletions

View file

@ -6,6 +6,7 @@ const mustache = require("gulp-mustache");
const rename = require("gulp-rename"); const rename = require("gulp-rename");
const gulpif = require("gulp-if"); const gulpif = require("gulp-if");
const gzip = require("gulp-gzip"); const gzip = require("gulp-gzip");
const cleancss = require("gulp-clean-css");
const paths = {}; const paths = {};
paths.app = "./resources/"; paths.app = "./resources/";
@ -54,10 +55,14 @@ function scssPipeline(options) {
const output = options.output; const output = options.output;
return gulp.src(input) return gulp.src(input)
// .pipe(plumber()) .pipe(scss({
.pipe(scss({style: "expanded"})) style: "expanded",
errLogToConsole: false
}).on("error", (err) => {
console.log(err.messageFormatted);
}))
.pipe(makeAutoprefixer()) .pipe(makeAutoprefixer())
// .pipe(gulpif(isProduction, cssmin())) .pipe(gulpif(isProduction, cleancss()))
.pipe(gulp.dest(output)); .pipe(gulp.dest(output));
}; };
} }

View file

@ -623,6 +623,15 @@
} }
} }
}, },
"clean-css": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.1.tgz",
"integrity": "sha512-4ZxI6dy4lrY6FHzfiy1aEOXgu4LIsW2MhwG0VBKdcoGoH/XLFgaHSdLTGr4O8Be6A8r3MOphEiI8Gc1n0ecf3g==",
"dev": true,
"requires": {
"source-map": "~0.6.0"
}
},
"cliui": { "cliui": {
"version": "3.2.0", "version": "3.2.0",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz",
@ -2140,6 +2149,29 @@
} }
} }
}, },
"gulp-clean-css": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/gulp-clean-css/-/gulp-clean-css-4.2.0.tgz",
"integrity": "sha512-r4zQsSOAK2UYUL/ipkAVCTRg/2CLZ2A+oPVORopBximRksJ6qy3EX1KGrIWT4ZrHxz3Hlobb1yyJtqiut7DNjA==",
"dev": true,
"requires": {
"clean-css": "4.2.1",
"plugin-error": "1.0.1",
"through2": "3.0.1",
"vinyl-sourcemaps-apply": "0.2.1"
},
"dependencies": {
"through2": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/through2/-/through2-3.0.1.tgz",
"integrity": "sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww==",
"dev": true,
"requires": {
"readable-stream": "2 || 3"
}
}
}
},
"gulp-gzip": { "gulp-gzip": {
"version": "1.4.2", "version": "1.4.2",
"resolved": "https://registry.npmjs.org/gulp-gzip/-/gulp-gzip-1.4.2.tgz", "resolved": "https://registry.npmjs.org/gulp-gzip/-/gulp-gzip-1.4.2.tgz",

View file

@ -14,8 +14,7 @@
"dist:main": "clojure -Adev tools.clj dist main", "dist:main": "clojure -Adev tools.clj dist main",
"dist:view": "clojure -Adev tools.clj dist view", "dist:view": "clojure -Adev tools.clj dist view",
"dist:worker": "clojure -Adev tools.clj dist worker", "dist:worker": "clojure -Adev tools.clj dist worker",
"dist:assets": "gulp dist", "dist:assets": "NODE_ENV=production gulp dist",
"prod": "gulp dist --production",
"start": "npm run figwheel", "start": "npm run figwheel",
"build:test": "clojure -Adev tools.clj build-tests", "build:test": "clojure -Adev tools.clj build-tests",
"build:main": "clojure -Adev tools.clj build main", "build:main": "clojure -Adev tools.clj build main",
@ -26,6 +25,7 @@
"devDependencies": { "devDependencies": {
"gulp": "4.0.2", "gulp": "4.0.2",
"gulp-autoprefixer": "^6.1.0", "gulp-autoprefixer": "^6.1.0",
"gulp-clean-css": "^4.2.0",
"gulp-gzip": "^1.4.2", "gulp-gzip": "^1.4.2",
"gulp-if": "^2.0.2", "gulp-if": "^2.0.2",
"gulp-mustache": "^4.1.1", "gulp-mustache": "^4.1.1",