Skip to content

Instantly share code, notes, and snippets.

@jeroensmink98
Created January 25, 2022 11:13
Show Gist options
  • Save jeroensmink98/8f2a9550b2b3df8c46ac40a70bf52eea to your computer and use it in GitHub Desktop.
Save jeroensmink98/8f2a9550b2b3df8c46ac40a70bf52eea to your computer and use it in GitHub Desktop.
Compile a Angular Project to a single HTML file
// Create gulpfile.js
const gulp = require("gulp");
const inline = require("gulp-inline");
gulp.task("default", () => {
return gulp
.src("./dist/*/*.html")
.pipe(inline())
.pipe(gulp.dest("./single-dist"));
});
// Install dependencies
// npm install --save-dev gulp gulp-inline
// Build Angular app with ng build
// after that run npx gulp to compile the build output to a single file
// or add this to package.json "build-single": "npm run build && npx gulp"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment