Closed sunm0710 closed 4 years ago
You can use a tool like gulp
to bundle all the CSS and JS in a single HTML file that can be pushed to the cloud.
I've written a tutorial for bundling React apps in a single file but the technique should be similar for vanilla HTML / JS.
const gulp = require('gulp')
const inlinesource = require('gulp-inline-source')
const replace = require('gulp-replace')
gulp.task('default', () => {
return gulp.src('./build/*.html')
.pipe(replace('.js"></script>', '.js" inline></script>'))
.pipe(replace('rel="stylesheet">', 'rel="stylesheet" inline>'))
.pipe(inlinesource({
compress: false,
ignore: ['png']
}))
.pipe(gulp.dest('./build'))
});
Hello, I really like this tool as a beginner of GAS developer. But I have some issue loading a js script in html file. Is there a recommend way to do this? Thank you!