Skip to content

Commit

Permalink
Merge branch 'development-improvements'
Browse files Browse the repository at this point in the history
  • Loading branch information
claydiffrient committed Apr 15, 2016
2 parents 0534928 + 9823bc5 commit f1555d9
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 22 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["es2015", "react"]
}
17 changes: 6 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
],
"license": "MIT",
"devDependencies": {
"browserify": "11.1.0",
"browserify-shim": "3.8.10",
"envify": "3.4.0",
"babel-core": "^6.7.4",
"babel-loader": "^6.2.4",
"babel-preset-es2015": "^6.6.0",
"babel-preset-react": "^6.5.0",
"expect": "1.10.0",
"jsx-loader": "0.13.2",
"karma": "^0.13.22",
"karma-browserify": "^4.2.1",
"karma-chrome-launcher": "0.2.0",
Expand All @@ -37,7 +37,6 @@
"react": "^15.0.0",
"react-addons-test-utils": "^15.0.0",
"react-dom": "^15.0.0",
"reactify": "^1.1.1",
"rf-release": "0.4.0",
"sinon": "^1.17.3",
"uglify-js": "2.4.24",
Expand All @@ -62,9 +61,5 @@
"react-component",
"modal",
"dialog"
],
"browserify-shim": {
"react": "global:React",
"react-dom": "global:ReactDOM"
}
}
]
}
11 changes: 1 addition & 10 deletions scripts/build
Original file line number Diff line number Diff line change
@@ -1,11 +1,2 @@
#!/bin/sh
mkdir -p dist
NODE_ENV=production node_modules/.bin/browserify lib/index.js \
-t reactify \
-t browserify-shim \
-t envify \
--detect-globals false \
-s ReactModal > dist/react-modal.js
node_modules/.bin/uglifyjs dist/react-modal.js \
--compress warnings=false > dist/react-modal.min.js

webpack --config webpack.dist.config.js -p
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module.exports = {

module: {
loaders: [
{ test: /\.js$/, loader: 'jsx-loader?harmony' }
{ test: /\.js$/, loader: 'babel' }
]
},

Expand Down
45 changes: 45 additions & 0 deletions webpack.dist.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
var webpack = require('webpack');
var UglifyJsPlugin = webpack.optimize.UglifyJsPlugin;
var env = process.env.WEBPACK_ENV;

module.exports = {

entry: {
'react-modal': './lib/index.js',
'react-modal.min': './lib/index.js'
},

externals: [
'react',
'react-dom'
],

output: {
filename: '[name].js',
chunkFilename: '[id].chunk.js',
path: 'dist',
publicPath: '/',
libraryTarget: 'umd',
library: 'ReactModal'
},

plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
}),
new UglifyJsPlugin({
include: /\.min\.js$/,
minimize: true,
compress: {
warnings: false
}
})
],

module: {
loaders: [
{ test: /\.js?$/, exclude: /node_modules/, loader: 'babel'},
]
}

};

0 comments on commit f1555d9

Please sign in to comment.