Skip to content

Commit

Permalink
Adds bower.json, webpack.config.js and updates package.json
Browse files Browse the repository at this point in the history
to support the new build process
  • Loading branch information
chollier committed Jan 20, 2015
1 parent f136180 commit aa410ba
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 2 deletions.
8 changes: 8 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "react-bootstrap-datetimepicker",
"version": "0.0.666666",
"main": [
"./dist/react-bootstrap-datetimepicker.min.js",
],
"ignore": []
}
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
"repository": {
"type": "git",
"url": "http://github.com/quri/react-bootstrap-datetimepicker"
}
},
"main": "./src/DateTimeField.jsx",
"scripts": {
"build": "./node_modules/.bin/grunt build",
"build": "NODE_ENV=production webpack --output-file react-bootstrap-datetimepicker.js",
"build-min": "NODE_ENV=production COMPRESS=1 webpack --output-file react-bootstrap-datetimepicker.min.js",
"examples": "webpack-dev-server --config ./examples/webpack.config.js",
"test-watch": "./node_modules/.bin/grunt watch 2>&1 >/dev/null & karma start karma.dev.js",
"test": "./node_modules/.bin/grunt build && karma start karma.ci.js"
Expand Down
41 changes: 41 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
var webpack = require('webpack');

var plugins = [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
})
];

if (process.env.COMPRESS) {
plugins.push(
new webpack.optimize.UglifyJsPlugin({
compressor: {
warnings: false
}
})
);
}

module.exports = {

entry: ['./src/DateTimeField.jsx'],

output: {
path: __dirname + "/dist/",
library: 'react-bootstrap-datetimepicker',
libraryTarget: 'umd',
},

resolve: {
extensions: ['', '.js', '.jsx']
},

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

plugins: plugins

};

0 comments on commit aa410ba

Please sign in to comment.