mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-25 15:39:25 +00:00
Use Webpack 5 filesystem cache
This commit is contained in:
parent
4f4611783d
commit
5253e51ccd
|
@ -12,6 +12,8 @@ const banner = `
|
||||||
`;
|
`;
|
||||||
|
|
||||||
module.exports = function (env, _) {
|
module.exports = function (env, _) {
|
||||||
|
const platform = env.platform || 'server';
|
||||||
|
|
||||||
const base = {
|
const base = {
|
||||||
// mode is set by package.json flags
|
// mode is set by package.json flags
|
||||||
entry: './src/server/index.tsx', // Point to main file
|
entry: './src/server/index.tsx', // Point to main file
|
||||||
|
@ -61,15 +63,19 @@ module.exports = function (env, _) {
|
||||||
banner,
|
banner,
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
|
cache: {
|
||||||
|
type: 'filesystem',
|
||||||
|
name: platform,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// server-specific configuration
|
// server-specific configuration
|
||||||
if (env.platform === 'server') {
|
if (platform === 'server') {
|
||||||
base.target = 'node';
|
base.target = 'node';
|
||||||
base.externals = [nodeExternals(), 'inferno-helmet'];
|
base.externals = [nodeExternals(), 'inferno-helmet'];
|
||||||
}
|
}
|
||||||
// client-specific configurations
|
// client-specific configurations
|
||||||
if (env.platform === 'client') {
|
if (platform === 'client') {
|
||||||
base.entry = './src/client/index.tsx';
|
base.entry = './src/client/index.tsx';
|
||||||
base.output.filename = 'js/client.js';
|
base.output.filename = 'js/client.js';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue