-
-
Notifications
You must be signed in to change notification settings - Fork 15.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revisit dependencies and add browser ready builds #142
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"stage": 0, | ||
"optional": ["runtime"] | ||
} | ||
"loose": "all" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
node_modules | ||
npm-debug.log | ||
.DS_Store | ||
dist | ||
lib | ||
coverage | ||
react.js | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Change Log | ||
All notable changes to this project will be documented in this file. | ||
This project adheres to [Semantic Versioning](http://semver.org/). | ||
|
||
## [Unreleased][unreleased] | ||
### Added | ||
- Dist build script (borrowed from flummox) to create distribution ready builds of redux | ||
that can be used in a browser directly. `dist/` is ignored by git. | ||
- Configuration for `cdnjs` autoimport from npm. | ||
|
||
### Changed | ||
- Clean up package.json by removing the unused browserify section; | ||
- Remove envify and babel-runtime as they aren't being used; | ||
- A change log :) | ||
|
||
[unreleased]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.11.1...HEAD |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh -e | ||
|
||
WEBPACK_CMD=node_modules/.bin/webpack | ||
|
||
mkdir -p dist | ||
|
||
$WEBPACK_CMD src/index.js dist/redux.js | ||
NODE_ENV=production $WEBPACK_CMD src/index.js dist/redux.min.js | ||
|
||
$WEBPACK_CMD src/react.js dist/redux-react.js | ||
NODE_ENV=production $WEBPACK_CMD src/react.js dist/redux-react.min.js | ||
|
||
$WEBPACK_CMD src/react-native.js dist/redux-react-native.js | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nah, let's ditch it, it's the same thing. |
||
NODE_ENV=production $WEBPACK_CMD src/react-native.js dist/redux-react-native.min.js |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
|
||
sh scripts/lint | ||
sh scripts/clean | ||
sh scripts/browser | ||
sh scripts/build |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
'use strict'; | ||
|
||
var webpack = require('webpack'); | ||
|
||
var plugins = [ | ||
new webpack.DefinePlugin({ | ||
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV) | ||
}), | ||
new webpack.optimize.OccurenceOrderPlugin() | ||
]; | ||
|
||
if (process.env.NODE_ENV === 'production') { | ||
plugins.push( | ||
new webpack.optimize.UglifyJsPlugin({ | ||
compressor: { | ||
screw_ie8: true, | ||
warnings: false | ||
} | ||
}) | ||
); | ||
} | ||
|
||
module.exports = { | ||
externals: { | ||
'react': 'React', | ||
'react-native': 'React' | ||
}, | ||
module: { | ||
loaders: [ | ||
{ test: /\.js$/, loaders: ['babel-loader'], exclude: /node_modules/ } | ||
] | ||
}, | ||
output: { | ||
library: 'Redux', | ||
libraryTarget: 'var' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe do a UMD build instead? Like React Router: https://github.com/rackt/react-router/blob/5d674c9515aa628b644c223b2e3f43bb28ac24bc/webpack.config.js#L7-L18 |
||
}, | ||
plugins: plugins, | ||
resolve: { | ||
extensions: ['', '.js'] | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to fill this from Releases page?