Skip to content

Commit ad8a7d3

Browse files
committed
Update config
1 parent 7786b86 commit ad8a7d3

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

preact.config.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,22 @@ export default (config, env, helpers) => {
77
const { plugin } = helpers.getPluginsByName(config, 'DefinePlugin')[0];
88
plugin.definitions['process.env.CONTENTFUL_ACCESS_TOKEN'] = JSON.stringify(process.env.CONTENTFUL_ACCESS_TOKEN);
99
plugin.definitions['process.env.CONTENTFUL_SPACE_ID'] = JSON.stringify(process.env.CONTENTFUL_SPACE_ID);
10+
if (env.isProd) {
11+
config.devtool = false;
12+
}
13+
if (!env.ssr) {
14+
config.output.filename = 'scripts/[name].js';
15+
config.output.chunkFilename = 'scripts/[name].js';
16+
config.optimization.splitChunks.cacheGroups = {
17+
default: false,
18+
vendors: false,
19+
route: false,
20+
chunks: false,
21+
styles: {
22+
name: 'styles',
23+
test: /\.s?css$/,
24+
enforce: true,
25+
},
26+
};
27+
}
1028
}

0 commit comments

Comments
 (0)