mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-07 14:39:25 +08:00
fix: use posix.resolve
This commit is contained in:
parent
5ecd48ad15
commit
80bd0e9870
@ -7,7 +7,7 @@
|
||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
||||
*/
|
||||
|
||||
const { resolve } = require('path');
|
||||
const { resolve, posix } = require('path');
|
||||
const { Command } = require('commander');
|
||||
const { readFileSync, writeFileSync } = require('fs');
|
||||
|
||||
@ -22,12 +22,12 @@ module.exports = (cli) => {
|
||||
let otherLocation = '';
|
||||
if (process.env.APP_PUBLIC_PATH !== '/') {
|
||||
otherLocation = `location / {
|
||||
alias {{cwd}}/node_modules/@nocobase/app/dist/client/;
|
||||
alias ${posix.resolve(process.cwd())}/node_modules/@nocobase/app/dist/client/;
|
||||
try_files $uri $uri/ /index.html;
|
||||
}`;
|
||||
}
|
||||
const replaced = data
|
||||
.replace(/\{\{cwd\}\}/g, '/app/nocobase')
|
||||
.replace(/\{\{cwd\}\}/g, posix.resolve(process.cwd()))
|
||||
.replace(/\{\{publicPath\}\}/g, process.env.APP_PUBLIC_PATH)
|
||||
.replace(/\{\{apiPort\}\}/g, process.env.APP_PORT)
|
||||
.replace(/\{\{otherLocation\}\}/g, otherLocation);
|
||||
|
Loading…
x
Reference in New Issue
Block a user