Changeset View
Changeset View
Standalone View
Standalone View
web/cashtab/config/webpack.config.js
Show First 20 Lines • Show All 268 Lines • ▼ Show 20 Lines | return { | ||||
// to bring better experience for Create React App users. You can replace | // to bring better experience for Create React App users. You can replace | ||||
// the line below with these two lines if you prefer the stock client: | // the line below with these two lines if you prefer the stock client: | ||||
// require.resolve('webpack-dev-server/client') + '?/', | // require.resolve('webpack-dev-server/client') + '?/', | ||||
// require.resolve('webpack/hot/dev-server'), | // require.resolve('webpack/hot/dev-server'), | ||||
isEnvDevelopment && | isEnvDevelopment && | ||||
require.resolve('react-dev-utils/webpackHotDevClient'), | require.resolve('react-dev-utils/webpackHotDevClient'), | ||||
// Finally, this is your app's code: | // Finally, this is your app's code: | ||||
paths.appI18nJs, | |||||
paths.appIndexJs, | paths.appIndexJs, | ||||
// We include the app code last so that if there is a runtime error during | // We include the app code last so that if there is a runtime error during | ||||
// initialization, it doesn't blow up the WebpackDevServer client, and | // initialization, it doesn't blow up the WebpackDevServer client, and | ||||
// changing JS code would still trigger a refresh. | // changing JS code would still trigger a refresh. | ||||
].filter(Boolean), | ].filter(Boolean), | ||||
output: { | output: { | ||||
// The build folder. | // The build folder. | ||||
path: isEnvProduction ? paths.appBuild : undefined, | path: isEnvProduction ? paths.appBuild : undefined, | ||||
▲ Show 20 Lines • Show All 106 Lines • ▼ Show 20 Lines | return { | ||||
}, | }, | ||||
resolve: { | resolve: { | ||||
// This allows you to set a fallback for where Webpack should look for modules. | // This allows you to set a fallback for where Webpack should look for modules. | ||||
// We placed these paths second because we want `node_modules` to "win" | // We placed these paths second because we want `node_modules` to "win" | ||||
// if there are any conflicts. This matches Node resolution mechanism. | // if there are any conflicts. This matches Node resolution mechanism. | ||||
// https://github.com/facebook/create-react-app/issues/253 | // https://github.com/facebook/create-react-app/issues/253 | ||||
modules: [ | modules: [ | ||||
'node_modules', | 'node_modules', | ||||
paths.appI18n, | |||||
paths.appNodeModules, | paths.appNodeModules, | ||||
].concat(modules.additionalModulePaths || []), | ].concat(modules.additionalModulePaths || []), | ||||
// These are the reasonable defaults supported by the Node ecosystem. | // These are the reasonable defaults supported by the Node ecosystem. | ||||
// We also include JSX as a common component filename extension to support | // We also include JSX as a common component filename extension to support | ||||
// some tools, although we do not recommend using it, see: | // some tools, although we do not recommend using it, see: | ||||
// https://github.com/facebook/create-react-app/issues/290 | // https://github.com/facebook/create-react-app/issues/290 | ||||
// `web` extension prefixes have been added for better support | // `web` extension prefixes have been added for better support | ||||
// for React Native Web. | // for React Native Web. | ||||
▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | return { | ||||
loaderMap: { | loaderMap: { | ||||
svg: { | svg: { | ||||
ReactComponent: | ReactComponent: | ||||
'@svgr/webpack?-svgo,+titleProp,+ref![path]', | '@svgr/webpack?-svgo,+titleProp,+ref![path]', | ||||
}, | }, | ||||
}, | }, | ||||
}, | }, | ||||
], | ], | ||||
[ | |||||
'babel-plugin-fbt', | |||||
{ | |||||
fbtEnumPath: path.join( | |||||
paths.appPath, | |||||
'.enum_manifest.json', | |||||
), | |||||
extraOptions: { __self: true }, | |||||
}, | |||||
], | |||||
'babel-plugin-fbt-runtime', | |||||
], | ], | ||||
// This is a feature of `babel-loader` for webpack (not Babel itself). | // This is a feature of `babel-loader` for webpack (not Babel itself). | ||||
// It enables caching results in ./node_modules/.cache/babel-loader/ | // It enables caching results in ./node_modules/.cache/babel-loader/ | ||||
// directory for faster rebuilds. | // directory for faster rebuilds. | ||||
cacheDirectory: true, | cacheDirectory: true, | ||||
// See #6846 for context on why cacheCompression is disabled | // See #6846 for context on why cacheCompression is disabled | ||||
cacheCompression: false, | cacheCompression: false, | ||||
compact: isEnvProduction, | compact: isEnvProduction, | ||||
▲ Show 20 Lines • Show All 274 Lines • Show Last 20 Lines |