Files
react-native-web/packages/benchmarks/webpack.config.js
T
Nicolas Gallagher 09ebf7bab5 Update benchmarks dependencies
Remove styled-jsx as it now throws "_JSXStyle is not defined". Library isn't
particularly fast and each update causes issues. Drop it.
2021-02-11 14:58:08 -08:00

59 lines
1.2 KiB
JavaScript

const babelPreset = require('../../scripts/babel/preset');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const path = require('path');
const appDirectory = path.resolve(__dirname);
module.exports = {
mode: 'production',
context: __dirname,
entry: './src/index',
output: {
path: path.resolve(appDirectory, 'dist'),
filename: 'bundle.js'
},
optimization: {
minimize: process.env.NODE_ENV === 'production'
},
module: {
rules: [
{
test: /\.css$/,
use: [
'style-loader',
{
loader: 'css-loader',
options: {
modules: {
localIdentName: '[hash:base64:8]'
}
}
}
]
},
{
test: /\.js$/,
include: [path.resolve(appDirectory, 'src')],
use: {
loader: 'babel-loader',
options: {
cacheDirectory: false,
presets: [babelPreset]
}
}
}
]
},
plugins: [
new BundleAnalyzerPlugin({
analyzerMode: 'static',
openAnalyzer: false
})
],
resolve: {
alias: {
'react-native': 'react-native-web'
}
}
};