mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
server build
This commit is contained in:
parent
5f23a4e3c7
commit
30dce78737
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
PKG_DIR=dist/trilium-linux-x64-server
|
PKG_DIR=dist/trilium-linux-x64-server
|
||||||
NODE_VERSION=18.18.2
|
NODE_VERSION=18.20.4
|
||||||
|
|
||||||
if [ "$1" != "DONTCOPY" ]
|
if [ "$1" != "DONTCOPY" ]
|
||||||
then
|
then
|
||||||
@ -23,9 +23,10 @@ rm -r $PKG_DIR/node_modules/electron*
|
|||||||
rm -r $PKG_DIR/webpack*
|
rm -r $PKG_DIR/webpack*
|
||||||
rm -r $PKG_DIR/electron.js
|
rm -r $PKG_DIR/electron.js
|
||||||
|
|
||||||
|
mkdir -p $PKG_DIR/node_modules/better-sqlite3/build/Release/
|
||||||
cp -r bin/better-sqlite3/linux-server-better_sqlite3.node $PKG_DIR/node_modules/better-sqlite3/build/Release/better_sqlite3.node
|
cp -r bin/better-sqlite3/linux-server-better_sqlite3.node $PKG_DIR/node_modules/better-sqlite3/build/Release/better_sqlite3.node
|
||||||
|
|
||||||
printf "#!/bin/sh\n./node/bin/node src/www" > $PKG_DIR/trilium.sh
|
printf "#!/bin/sh\nNODE_OPTIONS=\"-r ts-node/register\" ./node/bin/node src/www.ts" > $PKG_DIR/trilium.sh
|
||||||
chmod 755 $PKG_DIR/trilium.sh
|
chmod 755 $PKG_DIR/trilium.sh
|
||||||
|
|
||||||
cp bin/tpl/anonymize-database.sql $PKG_DIR/
|
cp bin/tpl/anonymize-database.sql $PKG_DIR/
|
||||||
|
@ -27,7 +27,7 @@ done
|
|||||||
cp webpack-* "$DIR"/ # here warning because there is no 'webpack-*', but webpack.config.js only
|
cp webpack-* "$DIR"/ # here warning because there is no 'webpack-*', but webpack.config.js only
|
||||||
|
|
||||||
# run in subshell (so we return to original dir)
|
# run in subshell (so we return to original dir)
|
||||||
(cd $DIR && n exec 18.18.2 npm install --only=prod)
|
(cd $DIR && n exec 18.20.4 npm install --omit=dev)
|
||||||
|
|
||||||
if [[ -d "$DIR"/node_modules ]]; then
|
if [[ -d "$DIR"/node_modules ]]; then
|
||||||
# cleanup of useless files in dependencies
|
# cleanup of useless files in dependencies
|
||||||
|
File diff suppressed because one or more lines are too long
@ -28,7 +28,7 @@
|
|||||||
"build-backend-docs": "rm -rf ./docs/backend_api && ./node_modules/.bin/jsdoc -c jsdoc-conf.json -d ./docs/backend_api src/becca/entities/*.js src/services/backend_script_api.js src/services/sql.js",
|
"build-backend-docs": "rm -rf ./docs/backend_api && ./node_modules/.bin/jsdoc -c jsdoc-conf.json -d ./docs/backend_api src/becca/entities/*.js src/services/backend_script_api.js src/services/sql.js",
|
||||||
"build-frontend-docs": "rm -rf ./docs/frontend_api && ./node_modules/.bin/jsdoc -c jsdoc-conf.json -d ./docs/frontend_api src/public/app/entities/*.js src/public/app/services/frontend_script_api.js src/public/app/widgets/basic_widget.js src/public/app/widgets/note_context_aware_widget.js src/public/app/widgets/right_panel_widget.js",
|
"build-frontend-docs": "rm -rf ./docs/frontend_api && ./node_modules/.bin/jsdoc -c jsdoc-conf.json -d ./docs/frontend_api src/public/app/entities/*.js src/public/app/services/frontend_script_api.js src/public/app/widgets/basic_widget.js src/public/app/widgets/note_context_aware_widget.js src/public/app/widgets/right_panel_widget.js",
|
||||||
"build-docs": "npm run build-backend-docs && npm run build-frontend-docs",
|
"build-docs": "npm run build-backend-docs && npm run build-frontend-docs",
|
||||||
"webpack": "webpack -c webpack.config.js",
|
"webpack": "webpack -c webpack.config.ts",
|
||||||
"test-jasmine": "TRILIUM_DATA_DIR=~/trilium/data-test jasmine",
|
"test-jasmine": "TRILIUM_DATA_DIR=~/trilium/data-test jasmine",
|
||||||
"test-es6": "node -r esm spec-es6/attribute_parser.spec.js ",
|
"test-es6": "node -r esm spec-es6/attribute_parser.spec.js ",
|
||||||
"test": "npm run test-jasmine && npm run test-es6",
|
"test": "npm run test-jasmine && npm run test-es6",
|
||||||
|
@ -4,15 +4,15 @@ const assetPath = require('./src/services/asset_path');
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
mode: 'production',
|
mode: 'production',
|
||||||
entry: {
|
entry: {
|
||||||
setup: './src/public/app/setup.ts',
|
setup: './src/public/app/setup.js',
|
||||||
mobile: './src/public/app/mobile.js',
|
mobile: './src/public/app/mobile.js',
|
||||||
desktop: './src/public/app/desktop.js',
|
desktop: './src/public/app/desktop.js'
|
||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
publicPath: `${assetPath}/app-dist/`,
|
publicPath: `${assetPath}/app-dist/`,
|
||||||
path: path.resolve(__dirname, 'src/public/app-dist'),
|
path: path.resolve(__dirname, 'src/public/app-dist'),
|
||||||
filename: '[name].js',
|
filename: '[name].js'
|
||||||
},
|
},
|
||||||
devtool: 'source-map',
|
devtool: 'source-map',
|
||||||
target: 'electron-renderer',
|
target: 'electron-renderer'
|
||||||
};
|
};
|
Loading…
x
Reference in New Issue
Block a user