run benchmarks against local styled-components

This commit is contained in:
Evan Scott
2018-07-05 12:57:13 -05:00
parent 1a8ea0a5ce
commit 646f90c636
4 changed files with 41 additions and 23 deletions

View File

@@ -1,4 +1,5 @@
node_modules
benchmarks/**/*.js
dist/**/*.js
src/decls/**/*.js
src/vendor/**/*.js

View File

@@ -9,6 +9,7 @@
.*/node_modules/metro-bundler/.*
.*/node_modules/metro-source-map/.*
.*/node_modules/babel-plugin-transform-react-remove-prop-types/.*
.*/benchmarks/.*
.*/dist/.*
.*/lib/.*
.*/node_modules/babel-plugin-flow-react-proptypes/src/__test__/.*

View File

@@ -5,7 +5,9 @@
{
"loose": true,
"modules": false,
"exclude": ["transform-es2015-typeof-symbol"],
"exclude": [
"transform-es2015-typeof-symbol"
],
"targets": {
"browsers": [
"chrome 38",
@@ -28,8 +30,20 @@
"babel-preset-flow"
],
"plugins": [
["babel-plugin-transform-class-properties", { loose: true }],
["babel-plugin-transform-object-rest-spread", { useBuiltIns: true }],
["babel-plugin-transform-react-remove-prop-types", { mode: "wrap" }]
[
"babel-plugin-transform-class-properties",
{ loose: true
}
],
[
"babel-plugin-transform-object-rest-spread",
{ useBuiltIns: true
}
],
[
"babel-plugin-transform-react-remove-prop-types",
{ mode: "wrap"
}
]
]
}
}

View File

@@ -1,7 +1,8 @@
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const path = require('path');
// @flow
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')
const path = require('path')
const appDirectory = path.resolve(__dirname);
const appDirectory = path.resolve(__dirname)
module.exports = {
mode: 'production',
@@ -9,7 +10,7 @@ module.exports = {
entry: './src/index',
output: {
path: path.resolve(appDirectory, 'dist'),
filename: 'bundle.js'
filename: 'bundle.js',
},
module: {
rules: [
@@ -19,28 +20,29 @@ module.exports = {
'style-loader',
{
loader: 'css-loader',
options: { module: true, localIdentName: '[hash:base64:8]' }
}
]
options: { module: true, localIdentName: '[hash:base64:8]' },
},
],
},
{
test: /\.js$/,
include: [path.resolve(appDirectory, 'src')],
include: [path.resolve(appDirectory, 'src'), path.resolve('..', 'src')],
use: {
loader: 'babel-loader'
}
}
]
loader: 'babel-loader',
},
},
],
},
plugins: [
new BundleAnalyzerPlugin({
analyzerMode: 'static',
openAnalyzer: false
})
openAnalyzer: false,
}),
],
resolve: {
alias: {
'react-native': 'react-native-web'
}
}
};
'react-native': 'react-native-web',
'styled-components': path.resolve('../src'),
},
},
}