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:
parent
5fdcae4196
commit
7c1168e797
3 changed files with 42 additions and 5 deletions
|
@ -6,6 +6,7 @@ const mustache = require("gulp-mustache");
|
|||
const rename = require("gulp-rename");
|
||||
const gulpif = require("gulp-if");
|
||||
const gzip = require("gulp-gzip");
|
||||
const cleancss = require("gulp-clean-css");
|
||||
|
||||
const paths = {};
|
||||
paths.app = "./resources/";
|
||||
|
@ -54,10 +55,14 @@ function scssPipeline(options) {
|
|||
const output = options.output;
|
||||
|
||||
return gulp.src(input)
|
||||
// .pipe(plumber())
|
||||
.pipe(scss({style: "expanded"}))
|
||||
.pipe(scss({
|
||||
style: "expanded",
|
||||
errLogToConsole: false
|
||||
}).on("error", (err) => {
|
||||
console.log(err.messageFormatted);
|
||||
}))
|
||||
.pipe(makeAutoprefixer())
|
||||
// .pipe(gulpif(isProduction, cssmin()))
|
||||
.pipe(gulpif(isProduction, cleancss()))
|
||||
.pipe(gulp.dest(output));
|
||||
};
|
||||
}
|
||||
|
|
32
frontend/package-lock.json
generated
32
frontend/package-lock.json
generated
|
@ -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": {
|
||||
"version": "3.2.0",
|
||||
"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": {
|
||||
"version": "1.4.2",
|
||||
"resolved": "https://registry.npmjs.org/gulp-gzip/-/gulp-gzip-1.4.2.tgz",
|
||||
|
|
|
@ -14,8 +14,7 @@
|
|||
"dist:main": "clojure -Adev tools.clj dist main",
|
||||
"dist:view": "clojure -Adev tools.clj dist view",
|
||||
"dist:worker": "clojure -Adev tools.clj dist worker",
|
||||
"dist:assets": "gulp dist",
|
||||
"prod": "gulp dist --production",
|
||||
"dist:assets": "NODE_ENV=production gulp dist",
|
||||
"start": "npm run figwheel",
|
||||
"build:test": "clojure -Adev tools.clj build-tests",
|
||||
"build:main": "clojure -Adev tools.clj build main",
|
||||
|
@ -26,6 +25,7 @@
|
|||
"devDependencies": {
|
||||
"gulp": "4.0.2",
|
||||
"gulp-autoprefixer": "^6.1.0",
|
||||
"gulp-clean-css": "^4.2.0",
|
||||
"gulp-gzip": "^1.4.2",
|
||||
"gulp-if": "^2.0.2",
|
||||
"gulp-mustache": "^4.1.1",
|
||||
|
|
Loading…
Add table
Reference in a new issue