Fix infra scripts

master
Edward Shen 2022-01-18 01:52:44 -08:00
parent 6859bffe05
commit 9a8658e744
Signed by: edward
GPG Key ID: 19182661E818369F
4 changed files with 12 additions and 12 deletions

View File

@ -20,20 +20,16 @@ set -euxo pipefail
cd "$(git rev-parse --show-toplevel)" || exit 1
# Build frontend assets
yarn
# Clean resources
rm -rf dist
yarn webpack
# Build frontend code
yarn
yarn build
mv dist/static/index.html dist
# Build server
cargo build --release --bin omegaupload-server
# Prepare assets for upload to webserver
mkdir -p dist/static
# Move everything that's not index.html into a `static` subdir
find dist -not -name index.html -type f -exec mv {} dist/static/ ";"
strip target/release/omegaupload-server
cp target/release/omegaupload-server dist/omegaupload-server

View File

@ -15,5 +15,9 @@
"dependencies": {
"highlight.js": "^11.4.0",
"highlightjs-line-numbers.js": "^2.8.0"
},
"scripts": {
"build": "webpack --mode production",
"clean": "(git rev-parse --show-toplevel && rm -rf node_modules dist web/pkg)"
}
}

View File

@ -17,7 +17,7 @@
import './main.scss';
const hljs = require('highlight.js');
window.hljs = hljs;
(window as any).hljs = hljs;
require('highlightjs-line-numbers.js');
function loadFromDb(mimeType: string, name?: string, language?: string) {

View File

@ -29,7 +29,7 @@ module.exports = {
extensions: ['.tsx', '.ts', '.js'],
},
output: {
path: path.resolve(__dirname, 'dist'),
path: path.resolve(__dirname, 'dist/static'),
filename: 'index.js',
},
plugins: [