-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #485 from EBISPOT/issue-468
issue-468: implement banner text on home page
- Loading branch information
Showing
5 changed files
with
75 additions
and
32 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,56 @@ | ||
|
||
import { exec } from "child_process"; | ||
import { build } from "esbuild"; | ||
import fs from 'fs' | ||
import { exec } from 'child_process' | ||
import fs from "fs"; | ||
|
||
let define = {} | ||
for (const k in process.env) { define[`process.env.${k}`] = JSON.stringify(process.env[k]) } | ||
let define = {}; | ||
for (const k in process.env) { | ||
define[`process.env.${k}`] = JSON.stringify(process.env[k]); | ||
} | ||
|
||
/// | ||
/// Build index.html (simple find and replace) | ||
/// | ||
console.log('### Building index.html') | ||
fs.writeFileSync('dist/index.html', | ||
fs.readFileSync('index.html.in') | ||
.toString() | ||
.split('%PUBLIC_URL%/').join(process.env.PUBLIC_URL || '/') | ||
.split('%PUBLIC_URL%').join(process.env.PUBLIC_URL || '/')); | ||
console.log("### Building index.html"); | ||
fs.writeFileSync( | ||
"dist/index.html", | ||
fs | ||
.readFileSync("index.html.in") | ||
.toString() | ||
.split("%PUBLIC_URL%/") | ||
.join(process.env.PUBLIC_URL || "/") | ||
.split("%PUBLIC_URL%") | ||
.join(process.env.PUBLIC_URL || "/") | ||
); | ||
|
||
/// | ||
/// Build bundle.js (esbuild) | ||
/// | ||
console.log('### Building bundle.js') | ||
console.log("### Building bundle.js"); | ||
build({ | ||
entryPoints: ["src/index.tsx"], | ||
bundle: true, | ||
platform: 'browser', | ||
outfile: "dist/bundle.js", | ||
define, | ||
plugins: [ | ||
], | ||
logLevel: 'info', | ||
sourcemap: 'linked', | ||
|
||
...(process.env.OLS_MINIFY === 'true' ? { | ||
minify: true | ||
} : { | ||
}) | ||
entryPoints: ["src/index.tsx"], | ||
bundle: true, | ||
platform: "browser", | ||
outfile: "dist/bundle.js", | ||
define, | ||
plugins: [], | ||
logLevel: "info", | ||
sourcemap: "linked", | ||
|
||
...(process.env.OLS_MINIFY === "true" | ||
? { | ||
minify: true, | ||
} | ||
: {}), | ||
}); | ||
|
||
|
||
/// | ||
/// Build styles.css (tailwind) | ||
/// | ||
console.log('### Building styles.css') | ||
exec('tailwind -i ./src/index.css -o ./dist/styles.css') | ||
|
||
|
||
console.log("### Building styles.css"); | ||
exec("tailwind -i ./src/index.css -o ./dist/styles.css"); | ||
|
||
/// | ||
/// Copy files | ||
/// | ||
console.log("### Copying misc files"); | ||
exec("cp ./src/banner.txt ./dist"); // home page banner text |
Empty file.
Empty file.
This file contains 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
This file contains 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