gtsocial-umbx

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

index.js (2058B)


      1 /*
      2 	GoToSocial
      3 	Copyright (C) GoToSocial Authors admin@gotosocial.org
      4 	SPDX-License-Identifier: AGPL-3.0-or-later
      5 
      6 	This program is free software: you can redistribute it and/or modify
      7 	it under the terms of the GNU Affero General Public License as published by
      8 	the Free Software Foundation, either version 3 of the License, or
      9 	(at your option) any later version.
     10 
     11 	This program is distributed in the hope that it will be useful,
     12 	but WITHOUT ANY WARRANTY; without even the implied warranty of
     13 	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     14 	GNU Affero General Public License for more details.
     15 
     16 	You should have received a copy of the GNU Affero General Public License
     17 	along with this program.  If not, see <http://www.gnu.org/licenses/>.
     18 */
     19 
     20 "use strict";
     21 
     22 const skulk = require("skulk");
     23 const fs = require("fs");
     24 const path = require("path");
     25 
     26 let cssEntryFiles = fs.readdirSync(path.join(__dirname, "./css")).map((file) => {
     27 	return path.join(__dirname, "./css", file);
     28 });
     29 
     30 const prodCfg = {
     31 	transform: [
     32 		["@browserify/uglifyify", {
     33 			global: true,
     34 			exts: ".js"
     35 		}],
     36 		["@browserify/envify", { global: true }]
     37 	]
     38 };
     39 
     40 skulk({
     41 	name: "GoToSocial",
     42 	basePath: __dirname,
     43 	assetPath: "../assets/",
     44 	prodCfg: {
     45 		servers: {
     46 			express: false,
     47 			livereload: false
     48 		}
     49 	},
     50 	servers: {
     51 		express: {
     52 			proxy: "http://127.0.0.1:8081",
     53 			assets: "/assets"
     54 		}
     55 	},
     56 	bundles: {
     57 		frontend: {
     58 			entryFile: "frontend",
     59 			outputFile: "frontend.js",
     60 			preset: ["js"],
     61 			prodCfg: prodCfg,
     62 			transform: [
     63 				["babelify", {
     64 					global: true,
     65 					ignore: [/node_modules\/(?!(photoswipe.*))/]
     66 				}]
     67 			],
     68 		},
     69 		settings: {
     70 			entryFile: "settings",
     71 			outputFile: "settings.js",
     72 			prodCfg: prodCfg,
     73 			transform: [
     74 				["babelify", {
     75 					global: true,
     76 					ignore: [/node_modules\/(?!nanoid)/]
     77 				}]
     78 			],
     79 			presets: [
     80 				"react",
     81 				["postcss", {
     82 					output: "settings-style.css"
     83 				}]
     84 			]
     85 		},
     86 		css: {
     87 			entryFiles: cssEntryFiles,
     88 			outputFile: "_discard",
     89 			presets: [["postcss", {
     90 				output: "_split"
     91 			}]]
     92 		}
     93 	}
     94 });