Skip to content
This repository has been archived by the owner on Oct 26, 2018. It is now read-only.

Commit

Permalink
Add umd build; fixes #354 (#362)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dattaya authored and timdorr committed Apr 25, 2016
1 parent 5075f34 commit ad0d41d
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,4 +1,5 @@
lib
dist
node_modules
coverage
*.log
5 changes: 4 additions & 1 deletion package.json
Expand Up @@ -16,7 +16,10 @@
],
"license": "MIT",
"scripts": {
"build": "mkdir -p lib && babel ./src -d lib",
"build": "npm run build:commonjs & npm run build:umd & npm run build:umd:min",
"build:commonjs": "mkdir -p lib && babel ./src -d lib",
"build:umd": "webpack dist/ReactRouterRedux.js",
"build:umd:min": "NODE_ENV=production webpack dist/ReactRouterRedux.min.js",
"lint": "eslint examples src test",
"test": "npm run lint && npm run test:node && npm run test:browser",
"test:node": "mocha --compilers js:babel-register --recursive ./test/*.spec.js",
Expand Down
29 changes: 29 additions & 0 deletions webpack.config.js
@@ -0,0 +1,29 @@
var webpack = require('webpack')

var config = {
entry: './src/index',
module: {
loaders: [
{ test: /\.js$/, loaders: [ 'babel' ], exclude: /node_modules/ }
]
},
output: {
library: 'ReactRouterRedux',
libraryTarget: 'umd'
},
plugins: [
new webpack.optimize.OccurenceOrderPlugin()
]
}

if (process.env.NODE_ENV === 'production') {
config.plugins.push(
new webpack.optimize.UglifyJsPlugin({
compressor: {
warnings: false
}
})
)
}

module.exports = config

0 comments on commit ad0d41d

Please sign in to comment.