(baseConfig, babelConfig, envVars)
| 109 | } |
| 110 | |
| 111 | async 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, |
no test coverage detected