mirror of
https://github.com/zhigang1992/react-native-web.git
synced 2026-05-10 05:09:07 +08:00
Use babel to transpile the source code without bundling it. Use webpack to create a standalone, productionized UMD bundle. Fix #50
32 lines
674 B
JavaScript
32 lines
674 B
JavaScript
var constants = require('./constants')
|
|
var webpack = require('webpack')
|
|
|
|
module.exports = {
|
|
devServer: {
|
|
contentBase: constants.EXAMPLES_DIRECTORY
|
|
},
|
|
entry: {
|
|
example: constants.EXAMPLES_DIRECTORY
|
|
},
|
|
module: {
|
|
loaders: [
|
|
{
|
|
test: /\.js$/,
|
|
exclude: /node_modules/,
|
|
loader: 'babel-loader',
|
|
query: { cacheDirectory: true }
|
|
}
|
|
]
|
|
},
|
|
output: {
|
|
filename: 'examples.js'
|
|
},
|
|
plugins: [
|
|
new webpack.DefinePlugin({
|
|
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development')
|
|
}),
|
|
new webpack.optimize.DedupePlugin(),
|
|
new webpack.optimize.OccurenceOrderPlugin()
|
|
]
|
|
}
|