mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-19 06:03:34 +01:00
Use temporary directory for esbuild
This commit is contained in:
parent
7c4959aff5
commit
b157ec9734
2 changed files with 5 additions and 8 deletions
|
@ -3,6 +3,7 @@
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
const eejs = require('../../eejs')
|
const eejs = require('../../eejs')
|
||||||
import fs from 'node:fs';
|
import fs from 'node:fs';
|
||||||
|
import os from 'node:os';
|
||||||
const fsp = fs.promises;
|
const fsp = fs.promises;
|
||||||
const toolbar = require('../../utils/toolbar');
|
const toolbar = require('../../utils/toolbar');
|
||||||
const hooks = require('../../../static/js/pluginfw/hooks');
|
const hooks = require('../../../static/js/pluginfw/hooks');
|
||||||
|
@ -89,7 +90,7 @@ const convertTypescript = (content: string) => {
|
||||||
const outputRaw = buildSync({
|
const outputRaw = buildSync({
|
||||||
stdin: {
|
stdin: {
|
||||||
contents: content,
|
contents: content,
|
||||||
resolveDir: path.join(settings.root, 'var','js'),
|
resolveDir: settings.root,
|
||||||
loader: 'js'
|
loader: 'js'
|
||||||
},
|
},
|
||||||
alias:{
|
alias:{
|
||||||
|
@ -222,7 +223,7 @@ const convertTypescriptWatched = (content: string, cb: (output:string, hash: str
|
||||||
build({
|
build({
|
||||||
stdin: {
|
stdin: {
|
||||||
contents: content,
|
contents: content,
|
||||||
resolveDir: path.join(settings.root, 'var','js'),
|
resolveDir: settings.root,
|
||||||
loader: 'js'
|
loader: 'js'
|
||||||
},
|
},
|
||||||
alias:{
|
alias:{
|
||||||
|
@ -276,10 +277,8 @@ exports.expressCreateServer = async (hookName: string, args: ArgsExpressType, cb
|
||||||
settings,
|
settings,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Create a temporary directory to store runtime-built JS files
|
||||||
|
const outdir = path.join(os.tmpdir(), 'js');
|
||||||
const outdir = path.join(settings.root, 'var','js')
|
|
||||||
// Create the outdir if it doesn't exist
|
|
||||||
if (!fs.existsSync(outdir)) {
|
if (!fs.existsSync(outdir)) {
|
||||||
fs.mkdirSync(outdir);
|
fs.mkdirSync(outdir);
|
||||||
}
|
}
|
||||||
|
|
2
var/js/.gitignore
vendored
2
var/js/.gitignore
vendored
|
@ -1,2 +0,0 @@
|
||||||
*.js
|
|
||||||
*.map
|
|
Loading…
Reference in a new issue