From: Orvar Segerström Date: Sun, 25 Oct 2020 10:58:47 +0000 (+0100) Subject: Use Webpack 5 filesystem cache X-Git-Url: http://these/git/%7B%60%24%7BwebArchiveUrl%7D/save/static/%24%7Bargs.pageFn.next%7D?a=commitdiff_plain;h=5253e51ccd7ed2a15862efdfaa24da41c8f1b8d9;p=lemmy-ui.git Use Webpack 5 filesystem cache --- diff --git a/webpack.config.js b/webpack.config.js index 1b34705..e9c4fb3 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -12,6 +12,8 @@ const banner = ` `; module.exports = function (env, _) { + const platform = env.platform || 'server'; + const base = { // mode is set by package.json flags entry: './src/server/index.tsx', // Point to main file @@ -61,15 +63,19 @@ module.exports = function (env, _) { banner, }), ], + cache: { + type: 'filesystem', + name: platform, + }, }; // server-specific configuration - if (env.platform === 'server') { + if (platform === 'server') { base.target = 'node'; base.externals = [nodeExternals(), 'inferno-helmet']; } // client-specific configurations - if (env.platform === 'client') { + if (platform === 'client') { base.entry = './src/client/index.tsx'; base.output.filename = 'js/client.js'; }