mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2026-02-19 16:22:07 +01:00
Update gulp to include space around =
This commit is contained in:
26
gulpfile.js
26
gulpfile.js
@@ -31,7 +31,7 @@ function generateCode(field_name, is_script) {
|
||||
|
||||
const prefix = is_script ? "<script type='text/javascript'>" : "<style>";
|
||||
const suffix = is_script ? "</script>" : "</style>";
|
||||
output = `const char ${field_name}[]="${prefix}${output}${suffix}";`;
|
||||
output = `const char ${field_name}[] = "${prefix}${output}${suffix}";`;
|
||||
|
||||
const target_path = path.join(path.dirname(file.path), destination);
|
||||
//console.log(`Updated ${target_path}`);
|
||||
@@ -96,23 +96,19 @@ function generateCode(field_name, is_script) {
|
||||
}
|
||||
|
||||
function minifyJs() {
|
||||
return (
|
||||
gulp
|
||||
.src("./src/httpserver/script.js")
|
||||
.pipe(dumpFileSize())
|
||||
.pipe(uglify())
|
||||
.pipe(generateCode("pageScript", true))
|
||||
);
|
||||
return gulp
|
||||
.src("./src/httpserver/script.js")
|
||||
.pipe(dumpFileSize())
|
||||
.pipe(uglify())
|
||||
.pipe(generateCode("pageScript", true));
|
||||
}
|
||||
|
||||
function minifyHassDiscoveryJs() {
|
||||
return (
|
||||
gulp
|
||||
.src("./src/httpserver/script_ha_discovery.js")
|
||||
.pipe(dumpFileSize())
|
||||
.pipe(uglify())
|
||||
.pipe(generateCode("ha_discovery_script", true))
|
||||
);
|
||||
return gulp
|
||||
.src("./src/httpserver/script_ha_discovery.js")
|
||||
.pipe(dumpFileSize())
|
||||
.pipe(uglify())
|
||||
.pipe(generateCode("ha_discovery_script", true));
|
||||
}
|
||||
|
||||
function minifyCss() {
|
||||
|
||||
@@ -598,13 +598,12 @@ int HTTP_ProcessPacket(http_request_t* request) {
|
||||
}
|
||||
|
||||
/*
|
||||
To edit the following two fields:
|
||||
1. Edit the files script.js (pageScript) or script.css (htmlHeadStyle)
|
||||
2. Generate compressed content using gulp or online compressor such as https://www.minifier.org/
|
||||
NOTE:
|
||||
|
||||
For using gulp, you need to have nodejs (https://nodejs.org/en/) installed.
|
||||
After that run, `npm install` at the root folder to install dependent dev packages.
|
||||
And then run `gulp` which will automatically update the fields.
|
||||
The following fields should not be manually edited.
|
||||
Instead, edit the script/css files in this folder and then re-generate the fields by running gulp.
|
||||
Gulp tasks should automatically appear in Visual Code or can be invoked from console.
|
||||
See https://github.com/openshwprojects/OpenBK7231T_App/blob/main/BUILDING.md for gulp setup.
|
||||
*/
|
||||
|
||||
//region_start htmlHeadStyle
|
||||
|
||||
Reference in New Issue
Block a user