mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-28 03:52:25 -05:00
fix bundler script paths
This commit is contained in:
parent
686ad409d3
commit
d191931932
3 changed files with 15 additions and 3 deletions
|
|
@ -17,3 +17,7 @@
|
|||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
// WARNING: currently dependencies get deduplicated with factor-bundle, but
|
||||
// our frontend templates don't load the common bundle.js since it contains React etc
|
||||
|
|
@ -75,6 +75,10 @@ fs.readdirSync(path.join(__dirname, "./css")).forEach((file) => {
|
|||
entryFiles.push(path.join(__dirname, "./css", file));
|
||||
});
|
||||
|
||||
if (!fs.existsSync(out())){
|
||||
fs.mkdirSync(out(), { recursive: true });
|
||||
}
|
||||
|
||||
const server = budoExpress({
|
||||
port: 8081,
|
||||
host: "localhost",
|
||||
|
|
|
|||
|
|
@ -49,6 +49,8 @@ module.exports = function splitCSS() {
|
|||
}
|
||||
}
|
||||
|
||||
const cssDir = path.join(__dirname, "../css");
|
||||
|
||||
stream.split("\n").forEach((line) => {
|
||||
if (line.startsWith("/* from")) {
|
||||
let found = fromRegex.exec(line);
|
||||
|
|
@ -56,10 +58,12 @@ module.exports = function splitCSS() {
|
|||
write();
|
||||
|
||||
let parts = path.parse(found[1]);
|
||||
if (parts.dir == "css") {
|
||||
if (path.relative(cssDir, path.join(process.cwd(), parts.dir)) == "") {
|
||||
input = parts.base;
|
||||
} else {
|
||||
input = found[1].replace(/\//g, "-");
|
||||
// prefix filename with path
|
||||
let relative = path.relative(path.join(__dirname, "../"), path.join(process.cwd(), found[1]));
|
||||
input = relative.replace(/\//g, "-");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
@ -69,4 +73,4 @@ module.exports = function splitCSS() {
|
|||
write();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue