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

Add umd build; fixes #354 #362

Merged
merged 1 commit into from
Apr 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
lib
dist
node_modules
coverage
*.log
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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