mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-05-27 08:13:46 +00:00
Initial test framework setup
This commit is contained in:
+7
-26
@@ -1,40 +1,22 @@
|
||||
var autoprefixer = require('autoprefixer-core');
|
||||
var ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||
var assign = require('object-assign');
|
||||
var base = require('./webpack-base.config.js');
|
||||
var webpack = require('webpack');
|
||||
var UglifyJsPlugin = webpack.optimize.UglifyJsPlugin;
|
||||
|
||||
module.exports = {
|
||||
module.exports = assign({}, base, {
|
||||
entry: {
|
||||
main: './src/index'
|
||||
},
|
||||
externals: [{
|
||||
react: true
|
||||
}],
|
||||
module: {
|
||||
loaders: [
|
||||
{
|
||||
test: /\.css$/,
|
||||
loader: ExtractTextPlugin.extract(
|
||||
'style-loader',
|
||||
'css-loader?module&localIdentName=[hash:base64:5]!postcss-loader'
|
||||
)
|
||||
},
|
||||
{
|
||||
test: /\.jsx?$/,
|
||||
exclude: /node_modules/,
|
||||
loader: 'babel-loader',
|
||||
query: { cacheDirectory: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
output: {
|
||||
filename: 'main.js',
|
||||
library: 'ReactWebSDK',
|
||||
filename: 'react-native-web.js',
|
||||
library: 'ReactNativeWeb',
|
||||
libraryTarget: 'commonjs2',
|
||||
path: './dist'
|
||||
},
|
||||
plugins: [
|
||||
new ExtractTextPlugin('react-web-sdk.css'),
|
||||
new UglifyJsPlugin({
|
||||
compress: {
|
||||
dead_code: true,
|
||||
@@ -43,6 +25,5 @@ module.exports = {
|
||||
warnings: true
|
||||
}
|
||||
})
|
||||
],
|
||||
postcss: [ autoprefixer ]
|
||||
};
|
||||
]
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user