mirror of
https://github.com/zhigang1992/react-native-web.git
synced 2026-04-28 12:24:51 +08:00
Rearrange the benchmark code so that each implementation is self-contained. Adds the SierpinskiTriangle case that 'emotion' introduced in their fork of the 'react-native-web' benchmarks. And make it possible to run benchmarks on a per-library basis.
58 lines
1.2 KiB
JavaScript
58 lines
1.2 KiB
JavaScript
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
|
|
const path = require('path');
|
|
const webpack = require('webpack');
|
|
|
|
module.exports = {
|
|
context: __dirname,
|
|
entry: ['babel-polyfill', './src/index'],
|
|
output: {
|
|
path: path.resolve(__dirname, 'dist'),
|
|
filename: 'performance.bundle.js'
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.css$/,
|
|
use: [
|
|
'style-loader',
|
|
{
|
|
loader: 'css-loader',
|
|
options: { module: true, localIdentName: '[hash:base64:8]' }
|
|
}
|
|
]
|
|
},
|
|
{
|
|
test: /\.js$/,
|
|
exclude: /node_modules/,
|
|
use: {
|
|
loader: 'babel-loader',
|
|
options: {
|
|
cacheDirectory: true
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
plugins: [
|
|
// new BundleAnalyzerPlugin({
|
|
// analyzerMode: 'static',
|
|
// openAnalyzer: false
|
|
// }),
|
|
new webpack.DefinePlugin({
|
|
'process.env.NODE_ENV': JSON.stringify('production')
|
|
}),
|
|
new webpack.optimize.UglifyJsPlugin({
|
|
compress: {
|
|
dead_code: true,
|
|
screw_ie8: true,
|
|
warnings: false
|
|
}
|
|
})
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'react-native': 'react-native-web'
|
|
}
|
|
}
|
|
};
|