2022-06-09 10:51:19 +00:00
|
|
|
/*
|
2022-09-29 10:02:41 +00:00
|
|
|
GoToSocial
|
2023-01-05 11:43:00 +00:00
|
|
|
Copyright (C) 2021-2023 GoToSocial Authors admin@gotosocial.org
|
2022-06-09 10:51:19 +00:00
|
|
|
|
2022-09-29 10:02:41 +00:00
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Affero General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
2022-06-09 10:51:19 +00:00
|
|
|
|
2022-09-29 10:02:41 +00:00
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU Affero General Public License for more details.
|
2022-06-09 10:51:19 +00:00
|
|
|
|
2022-09-29 10:02:41 +00:00
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2022-06-09 10:51:19 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
2022-11-02 15:31:43 +00:00
|
|
|
const skulk = require("skulk");
|
|
|
|
const fs = require("fs");
|
|
|
|
const path = require("path");
|
2022-06-09 10:51:19 +00:00
|
|
|
|
2022-11-02 15:31:43 +00:00
|
|
|
let cssEntryFiles = fs.readdirSync(path.join(__dirname, "./css")).map((file) => {
|
2022-10-03 14:46:38 +00:00
|
|
|
return path.join(__dirname, "./css", file);
|
2022-06-09 10:51:19 +00:00
|
|
|
});
|
|
|
|
|
2022-11-02 15:31:43 +00:00
|
|
|
const prodCfg = {
|
|
|
|
transform: [
|
|
|
|
["uglifyify", {
|
2022-10-03 14:46:38 +00:00
|
|
|
global: true,
|
2022-11-02 15:31:43 +00:00
|
|
|
exts: ".js"
|
|
|
|
}],
|
|
|
|
["@browserify/envify", {global: true}]
|
|
|
|
]
|
|
|
|
};
|
|
|
|
|
|
|
|
skulk({
|
|
|
|
name: "GoToSocial",
|
|
|
|
basePath: __dirname,
|
|
|
|
assetPath: "../assets/",
|
|
|
|
prodCfg: {
|
|
|
|
servers: {
|
|
|
|
express: false,
|
|
|
|
livereload: false
|
2022-10-03 14:46:38 +00:00
|
|
|
}
|
|
|
|
},
|
2022-11-02 15:31:43 +00:00
|
|
|
servers: {
|
|
|
|
express: {
|
|
|
|
proxy: "http://localhost:8081",
|
|
|
|
assets: "/assets"
|
2022-10-03 14:46:38 +00:00
|
|
|
}
|
|
|
|
},
|
2022-11-02 15:31:43 +00:00
|
|
|
bundles: {
|
|
|
|
frontend: {
|
|
|
|
entryFile: "frontend",
|
|
|
|
outputFile: "frontend.js",
|
|
|
|
preset: ["js"],
|
|
|
|
prodCfg: prodCfg,
|
|
|
|
transform: [
|
|
|
|
["babelify", {
|
|
|
|
global: true,
|
|
|
|
ignore: [/node_modules\/(?!(photoswipe.*))/]
|
|
|
|
}]
|
|
|
|
],
|
|
|
|
},
|
|
|
|
settings: {
|
|
|
|
entryFile: "settings",
|
|
|
|
outputFile: "settings.js",
|
|
|
|
prodCfg: prodCfg,
|
|
|
|
presets: [
|
|
|
|
"react",
|
|
|
|
["postcss", {
|
|
|
|
output: "settings-style.css"
|
|
|
|
}]
|
|
|
|
]
|
|
|
|
},
|
|
|
|
css: {
|
|
|
|
entryFiles: cssEntryFiles,
|
|
|
|
outputFile: "_discard",
|
|
|
|
presets: [["postcss", {
|
|
|
|
output: "_split"
|
|
|
|
}]]
|
|
|
|
}
|
2022-10-03 14:46:38 +00:00
|
|
|
}
|
2022-11-02 15:31:43 +00:00
|
|
|
});
|