mirror of
https://github.com/zhigang1992/react-native-web.git
synced 2026-01-12 22:51:09 +08:00
Depend on 'animatedjs/animated' for the Animation implementation. This patch also replaces 'es6-set' with a small shim to reduce impact on production bundle size. Fix #95
44 lines
961 B
JavaScript
44 lines
961 B
JavaScript
const path = require('path')
|
|
const webpack = require('webpack')
|
|
|
|
const EXAMPLES_DIRECTORY = __dirname
|
|
|
|
module.exports = {
|
|
devServer: {
|
|
contentBase: EXAMPLES_DIRECTORY
|
|
},
|
|
entry: {
|
|
example: EXAMPLES_DIRECTORY
|
|
},
|
|
module: {
|
|
loaders: [
|
|
{
|
|
test: /\.js$/,
|
|
exclude: /node_modules/,
|
|
loader: 'babel-loader',
|
|
query: { cacheDirectory: true }
|
|
}
|
|
]
|
|
},
|
|
output: {
|
|
filename: 'bundle.js'
|
|
},
|
|
plugins: [
|
|
new webpack.DefinePlugin({
|
|
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development')
|
|
}),
|
|
new webpack.optimize.DedupePlugin(),
|
|
// https://github.com/animatedjs/animated/issues/40
|
|
new webpack.NormalModuleReplacementPlugin(
|
|
/es6-set/,
|
|
path.join(__dirname, '../src/modules/polyfills/Set.js')
|
|
),
|
|
new webpack.optimize.OccurenceOrderPlugin()
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'react-native': path.join(__dirname, '../src')
|
|
}
|
|
}
|
|
}
|