MCPcopy Index your code
hub / github.com/redfin/react-server / packageCodeForBrowser

Function packageCodeForBrowser

packages/react-server-cli/src/compileClient.js:162–279  ·  view source on GitHub ↗
(entrypoints, outputDir, outputUrl, hot, minify, longTermCaching, stats)

Source from the content-addressed store, hash-verified

160}
161
162function packageCodeForBrowser(entrypoints, outputDir, outputUrl, hot, minify, longTermCaching, stats) {
163 const NonCachingExtractTextLoader = path.join(__dirname, "./NonCachingExtractTextLoader");
164 const extractTextLoader = require.resolve(NonCachingExtractTextLoader) + "?{remove:true}!css-loader";
165 let webpackConfig = {
166 entry: entrypoints,
167 output: {
168 path: outputDir,
169 // other than hot mode, the public path is set at runtime.
170 publicPath: hot ? outputUrl : undefined,
171 filename: `[name]${longTermCaching ? ".[chunkhash]" : ""}.bundle.js`,
172 chunkFilename: `[id]${longTermCaching ? ".[chunkhash]" : ""}.bundle.js`,
173 },
174 module: {
175 loaders: [
176 {
177 test: /\.jsx?$/,
178 loader: "babel",
179 exclude: /node_modules/,
180 },
181 {
182 test: /\.css$/,
183 loader: extractTextLoader,
184 },
185 {
186 test: /\.(eot|woff|woff2|ttf|ttc|png|svg|jpg|jpeg|gif|cgm|tiff|webp|bmp|ico)$/i,
187 loader: "file",
188 exclude: /node_modules/,
189 },
190 {
191 test: /\.json/,
192 loader: "json",
193 // exclude: /node_modules/,
194 },
195 {
196 test: /\.less/,
197 loader: extractTextLoader + "!less-loader",
198 exclude: /node_modules/,
199 },
200 {
201 test: /\.s(a|c)ss$/,
202 loader: extractTextLoader + "!sass-loader",
203 exclude: /node_modules/,
204 },
205 {
206 test: /\.md/,
207 loader: "raw",
208 exclude: /node_modules/,
209 },
210 ],
211 },
212 resolve: {
213 alias: {
214 // These need to be singletons.
215 "react" : callerDependency("react"),
216 "react-server" : callerDependency("react-server"),
217 },
218 },
219 resolveLoader: {

Callers 1

compileClient.jsFile · 0.85

Calls 2

pushMethod · 0.80
callerDependencyFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…