forked from artgenexyz/webflow-nft-components
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcraco.config.js
25 lines (24 loc) · 993 Bytes
/
craco.config.js
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
module.exports = {
webpack: {
alias: {},
configure: (webpackConfig, {env, paths}) => {
const isEnvProduction = env === "production";
const isEnvDevelopment = env === "development";
webpackConfig.output.libraryTarget = "umd";
webpackConfig.output.library = "NFTComponents";
webpackConfig.output.filename = isEnvProduction
? 'static/js/[name].js'
: isEnvDevelopment && 'static/js/bundle.js';
// Turn off chunking
webpackConfig.optimization = {};
const miniCssPlugin = webpackConfig.plugins.find(
({ constructor }) => constructor.name === 'MiniCssExtractPlugin'
);
if (miniCssPlugin) {
miniCssPlugin.options.filename = 'static/css/[name].css';
miniCssPlugin.options.chunkFilename = 'static/css/[name].css';
}
return webpackConfig;
},
},
}