Build UMD bundle from source

This commit is contained in:
Nicolas Gallagher
2017-02-05 16:50:35 -08:00
parent c9c1aab97e
commit d15dafc108
2 changed files with 18 additions and 4 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
import ListViewDataSource from './ListViewDataSource';
import { PropTypes } from 'react';
import ScrollView, { propTypes as ScrollViewPropTypes } from '../ScrollView';
import { propTypes as ScrollViewPropTypes } from '../ScrollView';
export default {
...ScrollViewPropTypes,
+17 -3
View File
@@ -2,12 +2,11 @@ const path = require('path')
const webpack = require('webpack')
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const SRC_DIRECTORY = './src'
const DIST_DIRECTORY = './dist'
module.exports = {
entry: {
main: DIST_DIRECTORY
},
entry: SRC_DIRECTORY,
externals: [
{
react: {
@@ -18,6 +17,21 @@ 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]' }
}
]
},
output: {
filename: 'ReactNative.js',
library: 'ReactNative',