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 ListViewDataSource from './ListViewDataSource';
import { PropTypes } from 'react'; import { PropTypes } from 'react';
import ScrollView, { propTypes as ScrollViewPropTypes } from '../ScrollView'; import { propTypes as ScrollViewPropTypes } from '../ScrollView';
export default { export default {
...ScrollViewPropTypes, ...ScrollViewPropTypes,
+17 -3
View File
@@ -2,12 +2,11 @@ const path = require('path')
const webpack = require('webpack') const webpack = require('webpack')
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const SRC_DIRECTORY = './src'
const DIST_DIRECTORY = './dist' const DIST_DIRECTORY = './dist'
module.exports = { module.exports = {
entry: { entry: SRC_DIRECTORY,
main: DIST_DIRECTORY
},
externals: [ externals: [
{ {
react: { 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: { output: {
filename: 'ReactNative.js', filename: 'ReactNative.js',
library: 'ReactNative', library: 'ReactNative',