0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-11 01:28:30 -05:00

Adapt frontend build process to the scss modules

This commit is contained in:
Andrey Antukh 2023-09-19 12:16:37 +02:00 committed by Alonso Torres
parent 836b4538dd
commit 8caeaefa98
3 changed files with 22 additions and 22 deletions

View file

@ -261,14 +261,6 @@ gulp.task("polyfills", function() {
.pipe(gulp.dest(paths.output + "js/"));
});
/***********************************************
* Development
***********************************************/
gulp.task("clean", function(next) {
rimraf(paths.output).finally(next)
});
gulp.task("copy:assets:images", function() {
return gulp.src(paths.resources + "images/**/*")
.pipe(gulp.dest(paths.output + "images/"));
@ -297,18 +289,20 @@ gulp.task("watch:main", function() {
gulp.series("templates"));
});
gulp.task("build", gulp.parallel("polyfills", "scss", "templates", "copy:assets"));
gulp.task("watch", gulp.series("dev:dirs", "build", "watch:main"));
gulp.task("clean:output", function(next) {
rimraf(paths.output).finally(next)
});
/***********************************************
* Production
***********************************************/
gulp.task("dist:clean", function(next) {
gulp.task("clean:dist", function(next) {
rimraf(paths.dist).finally(next);
});
gulp.task("dist:copy", function() {
gulp.task("build:styles", gulp.parallel("scss"));
gulp.task("build:assets", gulp.parallel("polyfills", "templates", "copy:assets"));
gulp.task("watch", gulp.series("dev:dirs", "build:styles", "build:assets", "watch:main"));
gulp.task("build:copy", function() {
return gulp.src(paths.output + "**/*")
.pipe(gulp.dest(paths.dist));
});

View file

@ -18,12 +18,16 @@
"test:run": "node target/tests.js",
"test:watch": "clojure -M:dev:shadow-cljs watch test",
"test": "yarn run test:compile && yarn run test:run",
"test:e2e": "cypress run",
"test:e2e-gui": "cypress open",
"gulp:watch": "gulp watch",
"watch": "shadow-cljs watch main",
"validate-translations": "node ./scripts/validate-translations.js",
"find-unused-translations": "node ./scripts/find-unused-translations.js",
"test:e2e": "cypress run",
"test:e2e-gui": "cypress open"
"build:clean": "gulp clean:output && gulp clean:dist",
"build:styles": "gulp build:styles",
"build:assets": "gulp build:assets",
"build:copy": "gulp build:copy"
},
"devDependencies": {
"autoprefixer": "^10.4.15",

View file

@ -8,11 +8,13 @@ CURRENT_HASH=${CURRENT_HASH:-$(git rev-parse --short HEAD)};
EXTRA_PARAMS=$SHADOWCLJS_EXTRA_PARAMS;
yarn install || exit 1;
npx gulp clean || exit 1;
yarn run build:clean || exit 1;
yarn run build:styles || exit 1;
clojure -J-Xms100M -J-Xmx800M -J-XX:+UseSerialGC -M:dev:shadow-cljs release main --config-merge "{:release-version \"${CURRENT_HASH}\"}" $EXTRA_PARAMS || exit 1
npx gulp build || exit 1;
npx gulp dist:clean || exit 1;
npx gulp dist:copy || exit 1;
yarn run build:assets || exit 1;
yarn run build:copy || exit 1;
sed -i -re "s/\%version\%/$CURRENT_VERSION/g" ./target/dist/index.html;
sed -i -re "s/\%buildDate\%/$BUILD_DATE/g" ./target/dist/index.html;