-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpluffa.config.mjs
More file actions
26 lines (26 loc) · 798 Bytes
/
Copy pathpluffa.config.mjs
File metadata and controls
26 lines (26 loc) · 798 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/**
* @param {import('pluffa/config').CommandName} cmd
* @return {Promise<import('@pluffa/node/config').NodeConfig>}
*/
export default async (cmd) => {
return {
runtime: 'node',
clientEntry: {
main: './src/index.tsx',
inline: './src/inline.ts',
},
serverComponent: './src/server/Server.tsx',
skeletonComponent: './src/server/Skeleton.tsx',
clientSourceMap: cmd === 'dev' ? true : false,
exitStaticizeOnError: true,
experimentalUseSwc: true,
urls: ['/', '/404.html'],
experimentalConfigureWebpackClient: (config) => {
if (cmd === 'dev') {
// https://github.com/pmmmwh/react-refresh-webpack-plugin/issues/88#issuecomment-627558799
config.optimization = { runtimeChunk: 'single' }
}
return config
},
}
}