Files
react-native-web/packages/benchmarks/webpack.config.js
2022-07-03 17:37:19 -07:00

59 lines
1.2 KiB
JavaScript

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,
extends: path.resolve(appDirectory, '../../configs/babel.config')
}
}
}
]
},
plugins: [
new BundleAnalyzerPlugin({
analyzerMode: 'static',
openAnalyzer: false
})
],
resolve: {
alias: {
'react-native': 'react-native-web'
}
}
};