Open filipecalegario opened 3 years ago
Hey Filipe!
Inside gulp script there is the section that takes care of the js, css files:
/* Process HTML, CSS, JS --- LINE --- */
gulp.task('inline', function() {
return gulp.src('./*.html')
.pipe(inline({
base: './',
js: uglify,
css: cleancss,
//disabledTypes: ['svg', 'img']
//disabledTypes: ['img']
}))
.pipe(htmlmin({
collapseWhitespace: true,
removeComments: true,
minifyCSS: true,
minifyJS: true
}))
.pipe(gzip())
.pipe(gulp.dest('dist'));
});
/* Process HTML, CSS, JS */
gulp.task('html', function() {
return gulp.src('./*.html')
.pipe(useref())
.pipe(plumber())
.pipe(gulpif('*.css', cleancss()))
.pipe(gulpif('*.js', uglify()))
.pipe(gulpif('*.html', htmlmin({
collapseWhitespace: true,
removeComments: true,
minifyCSS: true,
minifyJS: true
})))
.pipe(gzip())
.pipe(gulp.dest('dist'));
});
So it should work if you keep the file structure the same as the project.
If you do not modify index.html, does it work?
Hi @filipecalegario,
late to the party but you have to run gulp buildfs2
in order to inline css and js.
@giobauermeister there are two buildfs tasks and I think you want the second to be the default?
see:
gulp.task('buildfs', gulp.series('clean', 'files', 'html'));
gulp.task('buildfs2', gulp.series('clean', 'files', 'inline'));
gulp.task('compilepage', gulp.series('delgzip', 'files', 'inline'));
gulp.task('default', gulp.series('buildfs'));
Hello,
I edited the
index.html
file to change some of the titles.When I run
gulp
, there is no error, but the resulting file has no CSS either JS files embedded into index.html.gz.I even uploaded to an ESP32 and, when I open it, the server works fine, but the page come with no style either functionalities.
If I want to modify the
index.html
, is that the right workflow: 1) alter theindex.html
file and 2) rungulp
command? Are there other steps I'm not following?Thanks!