MCPcopy Create free account
hub / github.com/CommE2E/comm / createProdBrowserConfig

Function createProdBrowserConfig

lib/webpack/shared.cjs:111–182  ·  view source on GitHub ↗
(baseConfig, babelConfig, envVars)

Source from the content-addressed store, hash-verified

109}
110
111async function createProdBrowserConfig(baseConfig, babelConfig, envVars) {
112 const browserConfig = createBaseBrowserConfig(baseConfig);
113 const babelRule = getBrowserBabelRule(babelConfig);
114 const { alchemyKey, walletConnectKey, neynarKey } = await getConfigs();
115 return {
116 ...browserConfig,
117 mode: 'production',
118 plugins: [
119 ...browserConfig.plugins,
120 new webpack.DefinePlugin({
121 'process.env': {
122 NODE_ENV: JSON.stringify('production'),
123 BROWSER: true,
124 COMM_ALCHEMY_KEY: JSON.stringify(alchemyKey),
125 COMM_WALLETCONNECT_KEY: JSON.stringify(walletConnectKey),
126 COMM_NEYNAR_KEY: JSON.stringify(neynarKey),
127 ...envVars,
128 },
129 }),
130 new MiniCssExtractPlugin({
131 filename: 'prod.[contenthash:12].build.css',
132 }),
133 ],
134 module: {
135 rules: [
136 {
137 ...babelRule,
138 options: {
139 ...babelRule.options,
140 plugins: [
141 ...babelRule.options.plugins,
142 '@babel/plugin-transform-react-constant-elements',
143 [
144 'transform-remove-console',
145 { exclude: ['error', 'warn', 'info'] },
146 ],
147 ],
148 },
149 },
150 {
151 test: /\.css$/,
152 exclude: /node_modules\/.*\.css$/,
153 use: [
154 cssExtractLoader,
155 {
156 ...cssLoader,
157 options: {
158 ...cssLoader.options,
159 url: false,
160 },
161 },
162 ],
163 },
164 {
165 test: /node_modules\/.*\.css$/,
166 sideEffects: true,
167 use: [
168 cssExtractLoader,

Callers 2

webpack.config.cjsFile · 0.85
webpack.config.cjsFile · 0.85

Calls 3

createBaseBrowserConfigFunction · 0.85
getBrowserBabelRuleFunction · 0.85
getConfigsFunction · 0.85

Tested by

no test coverage detected