) {
const user = UserService.Instance;
let caching: string;
+ console.log("In middleware");
+ console.log(process.env.NODE_ENV);
if (
- req.path.match(/\.(js|css|txt|manifest\.webmanifest)\/?$/) ||
- req.path.includes("/css/themelist")
+ process.env.NODE_ENV === "production" &&
+ (req.path.match(/\.(js|css|txt|manifest\.webmanifest)\/?$/) ||
+ req.path.includes("/css/themelist"))
) {
// Static content gets cached publicly for a day
caching = "public, max-age=86400";
@license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0
`;
-function getBase(env) {
+function getBase(env, mode) {
return {
output: {
filename: "js/server.js",
plugins: [
new webpack.DefinePlugin({
"process.env.COMMIT_HASH": `"${env.COMMIT_HASH}"`,
+ "process.env.NODE_ENV": `"${mode}"`,
}),
new MiniCssExtractPlugin({
filename: "styles/styles.css",
}
const createServerConfig = (env, mode) => {
- const base = getBase(env);
+ const base = getBase(env, mode);
const config = merge({}, base, {
mode,
entry: "./src/server/index.tsx",
};
const createClientConfig = (env, mode) => {
- const base = getBase(env);
+ const base = getBase(env, mode);
const config = merge({}, base, {
mode,
entry: "./src/client/index.tsx",