]> Untitled Git - lemmy-ui.git/blobdiff - webpack.config.js
Fixing timezone issue with date-fns. Fixes #1680 (#1681)
[lemmy-ui.git] / webpack.config.js
index dcb88c52cb0046e81132b2471b6327586a0d3264..a2b31d04383f752d93d99a739fd9fad42ab044c8 100644 (file)
@@ -6,8 +6,7 @@ const CopyPlugin = require("copy-webpack-plugin");
 const RunNodeWebpackPlugin = require("run-node-webpack-plugin");
 const merge = require("lodash.merge");
 const { ServiceWorkerPlugin } = require("service-worker-webpack");
-const BundleAnalyzerPlugin =
-  require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
+
 const banner = `
   hash:[contentHash], chunkhash:[chunkhash], name:[name], filebase:[base], query:[query], file:[file]
   Source code: https://github.com/LemmyNet/lemmy-ui
@@ -97,6 +96,7 @@ const createClientConfig = (_env, mode) => {
     entry: "./src/client/index.tsx",
     output: {
       filename: "js/client.js",
+      publicPath: "/static/",
     },
     plugins: [
       ...base.plugins,
@@ -107,7 +107,7 @@ const createClientConfig = (_env, mode) => {
             "/": "/static/",
           },
           cacheId: "lemmy",
-          include: [/(assets|styles)\/.+\..+|client\.js$/g],
+          include: [/(assets|styles|js)\/.+\..+$/g],
           inlineWorkboxRuntime: true,
           runtimeCaching: [
             {
@@ -156,6 +156,8 @@ const createClientConfig = (_env, mode) => {
   });
 
   if (mode === "none") {
+    const BundleAnalyzerPlugin =
+      require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
     config.plugins.push(new BundleAnalyzerPlugin());
   }