mirror of
https://github.com/zhigang1992/react-native-web.git
synced 2026-04-29 21:04:53 +08:00
Initial setup of react-storybook. Includes examples copied from the React Native repository. Close #148
37 lines
868 B
JavaScript
37 lines
868 B
JavaScript
const path = require('path')
|
|
const webpack = require('webpack')
|
|
|
|
module.exports = {
|
|
module: {
|
|
loaders: [
|
|
{
|
|
test: /\.js$/,
|
|
exclude: /node_modules/,
|
|
loader: 'babel-loader',
|
|
query: { cacheDirectory: true }
|
|
},
|
|
{
|
|
test: /\.(gif|jpe?g|png|svg)$/,
|
|
loader: 'url-loader',
|
|
query: { name: '[name].[ext]' }
|
|
}
|
|
]
|
|
},
|
|
plugins: [
|
|
new webpack.DefinePlugin({
|
|
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development')
|
|
}),
|
|
// 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')
|
|
}
|
|
}
|
|
}
|