mirror of
https://github.com/zhigang1992/react-native-web.git
synced 2026-01-12 22:51:09 +08:00
Include React and ReactDOM in the UMD bundle. The library occupies the `React` global. Fix #105
29 lines
622 B
JavaScript
29 lines
622 B
JavaScript
var webpack = require('webpack')
|
|
|
|
const DIST_DIRECTORY = './dist'
|
|
|
|
module.exports = {
|
|
entry: {
|
|
main: DIST_DIRECTORY
|
|
},
|
|
output: {
|
|
filename: 'ReactNative.js',
|
|
library: 'React',
|
|
libraryTarget: 'umd',
|
|
path: DIST_DIRECTORY
|
|
},
|
|
plugins: [
|
|
new webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify('production') }),
|
|
new webpack.optimize.DedupePlugin(),
|
|
new webpack.optimize.OccurenceOrderPlugin(),
|
|
new webpack.optimize.UglifyJsPlugin({
|
|
compress: {
|
|
dead_code: true,
|
|
drop_console: true,
|
|
screw_ie8: true,
|
|
warnings: true
|
|
}
|
|
})
|
|
]
|
|
}
|