Created
January 25, 2022 11:13
-
-
Save jeroensmink98/8f2a9550b2b3df8c46ac40a70bf52eea to your computer and use it in GitHub Desktop.
Compile a Angular Project to a single HTML file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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