mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-08 06:59:26 +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.
|
* 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 { Command } = require('commander');
|
||||||
const { readFileSync, writeFileSync } = require('fs');
|
const { readFileSync, writeFileSync } = require('fs');
|
||||||
|
|
||||||
@ -22,12 +22,12 @@ module.exports = (cli) => {
|
|||||||
let otherLocation = '';
|
let otherLocation = '';
|
||||||
if (process.env.APP_PUBLIC_PATH !== '/') {
|
if (process.env.APP_PUBLIC_PATH !== '/') {
|
||||||
otherLocation = `location / {
|
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;
|
try_files $uri $uri/ /index.html;
|
||||||
}`;
|
}`;
|
||||||
}
|
}
|
||||||
const replaced = data
|
const replaced = data
|
||||||
.replace(/\{\{cwd\}\}/g, '/app/nocobase')
|
.replace(/\{\{cwd\}\}/g, posix.resolve(process.cwd()))
|
||||||
.replace(/\{\{publicPath\}\}/g, process.env.APP_PUBLIC_PATH)
|
.replace(/\{\{publicPath\}\}/g, process.env.APP_PUBLIC_PATH)
|
||||||
.replace(/\{\{apiPort\}\}/g, process.env.APP_PORT)
|
.replace(/\{\{apiPort\}\}/g, process.env.APP_PORT)
|
||||||
.replace(/\{\{otherLocation\}\}/g, otherLocation);
|
.replace(/\{\{otherLocation\}\}/g, otherLocation);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user