mirror of
https://github.com/wassname/talk.git
synced 2026-06-28 22:21:45 +08:00
9d1f03115f
* feat: initial serverside featuring support * Update schema.graphql * feat: add feature comment to moderation dropdown * feat: feature comments on the stream embed * fix: tests * fix: optimize loading and fix tests * feat: hide featured tab when empty * feat: introduced flattening * fix: snapshots * fix: spacing * feat: added a dark variant to popover * feat: add featured comments tooltip * fix: better tests * feat: added tag counts * chore: changed string to enum * fix: removed unused translation * fix: changed schema for String -> TAG * feat: split comments -> comments, featuredComments * fix: adapt client to new endpoints * feat: use featured comment counts * test: featured count handling * fix: snapshots and optimistically approve comment during feature * fix: remove unnecessary assertion * feat: approve featured comments * fix: make optimistic update less reliant on existing data
108 lines
3.0 KiB
JavaScript
108 lines
3.0 KiB
JavaScript
// Apply all the configuration provided in the .env file.
|
|
require("dotenv").config();
|
|
|
|
const path = require("path");
|
|
const fs = require("fs");
|
|
const TsconfigPathsPlugin = require("tsconfig-paths-webpack-plugin");
|
|
const extensions = [".ts", ".tsx", ".js"];
|
|
// TODO: There is some weird issue with including paths.ts here
|
|
const postCSSConfigPath = "./src/core/build/postcss.config";
|
|
const isProduction = process.NODE_ENV === "production";
|
|
const appDirectory = fs.realpathSync(process.cwd());
|
|
|
|
const styleLoader = {
|
|
loader: require.resolve("style-loader"),
|
|
options: {
|
|
sourceMap: true,
|
|
hmr: true,
|
|
},
|
|
};
|
|
|
|
export default {
|
|
title: "Coral 5.0",
|
|
source: "./src",
|
|
typescript: true,
|
|
host: process.env.HOST || "0.0.0.0",
|
|
port: parseInt(process.env.DOCZ_PORT, 10) || 3030,
|
|
codeSandbox: false, // Too large to create code sandboxes..
|
|
modifyBundlerConfig: config => {
|
|
config.entry.app.push(
|
|
`${appDirectory}/src/core/client/ui/theme/variables.css.ts`
|
|
);
|
|
config.module.rules.push({
|
|
test: /\.css\.ts$/,
|
|
use: [
|
|
styleLoader,
|
|
{
|
|
loader: require.resolve("css-loader"),
|
|
options: {
|
|
modules: true,
|
|
importLoaders: 2,
|
|
localIdentName: "[name]-[local]-[hash:base64:5]",
|
|
sourceMap: true,
|
|
},
|
|
},
|
|
{
|
|
loader: require.resolve("postcss-loader"),
|
|
options: {
|
|
config: {
|
|
path: postCSSConfigPath,
|
|
},
|
|
parser: "postcss-js",
|
|
},
|
|
},
|
|
{
|
|
loader: require.resolve("babel-loader"),
|
|
options: {
|
|
configFile: false,
|
|
babelrc: false,
|
|
presets: [
|
|
"@babel/typescript",
|
|
[
|
|
"@babel/env",
|
|
{ targets: { node: "10.0.0" }, modules: "commonjs" },
|
|
],
|
|
],
|
|
// This is a feature of `babel-loader` for webpack (not Babel itself).
|
|
// It enables caching results in ./node_modules/.cache/babel-loader/
|
|
// directory for faster rebuilds.
|
|
cacheDirectory: true,
|
|
},
|
|
},
|
|
],
|
|
});
|
|
config.module.rules.push({
|
|
test: /\.css$/,
|
|
use: [
|
|
styleLoader,
|
|
{
|
|
loader: require.resolve("css-loader"),
|
|
options: {
|
|
modules: true,
|
|
importLoaders: 1,
|
|
localIdentName: "[name]-[local]-[hash:base64:5]",
|
|
sourceMap: true,
|
|
},
|
|
},
|
|
{
|
|
loader: require.resolve("postcss-loader"),
|
|
options: {
|
|
config: {
|
|
path: postCSSConfigPath,
|
|
},
|
|
},
|
|
},
|
|
],
|
|
});
|
|
config.resolve.plugins = [
|
|
new TsconfigPathsPlugin({
|
|
extensions,
|
|
// TODO: There is some weird issue with including paths.ts here
|
|
configFile: "./src/core/client/tsconfig.json",
|
|
}),
|
|
];
|
|
// fs.writeFileSync(path.resolve(__dirname, "tmp"), stringify(config, null, 2));
|
|
return config;
|
|
},
|
|
};
|