Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minify CSS and Gov JS #6

Merged
merged 2 commits into from
Mar 30, 2021
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
7 changes: 5 additions & 2 deletions ApplyToBecomeInternal/ApplyToBecomeInternal/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ var gulp = require("gulp");
var sass = require("gulp-dart-sass");
var async = require("async");
var rename = require("gulp-rename");
var cleanCSS = require('gulp-clean-css');
var uglify = require('gulp-uglify');

const buildSass = () => gulp.src("wwwroot/css/*.scss")
.pipe(sass().on("error", sass.logError))
.pipe(cleanCSS())
.pipe(gulp.dest("wwwroot/css"));

const copyGovukAssets = () => gulp.src(["node_modules/govuk-frontend/govuk/assets/**/*"]).pipe(gulp.dest("wwwroot/assets")).on("end", () =>
gulp.src(["node_modules/govuk-frontend/govuk/all.js"]).pipe(rename("govuk.js")).pipe(gulp.dest("wwwroot/js/")));
gulp.src(["node_modules/govuk-frontend/govuk/all.js"]).pipe(uglify()).pipe(rename("govuk.js")).pipe(gulp.dest("wwwroot/js/")));

gulp.task("sass", buildSass);

Expand All @@ -25,4 +28,4 @@ gulp.task("build-fe", () => {
(next) => buildSass().on("end", next),
(next) => copyGovukAssets().on("end", next)
])
});
});
79 changes: 79 additions & 0 deletions ApplyToBecomeInternal/ApplyToBecomeInternal/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions ApplyToBecomeInternal/ApplyToBecomeInternal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
"async": "^3.2.0",
"govuk-frontend": "^3.11.0",
"gulp": "^4.0.2",
"gulp-clean-css": "^4.3.0",
"gulp-dart-sass": "^1.0.2",
"gulp-rename": "^2.0.0",
"gulp-uglify": "^3.0.2",
"sass": "^1.32.8"
}
}