Skip to content
This repository was archived by the owner on Nov 16, 2018. It is now read-only.

Commit aa410ba

Browse files
committed
Adds bower.json, webpack.config.js and updates package.json
to support the new build process
1 parent f136180 commit aa410ba

File tree

3 files changed

+53
-2
lines changed

3 files changed

+53
-2
lines changed

bower.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "react-bootstrap-datetimepicker",
3+
"version": "0.0.666666",
4+
"main": [
5+
"./dist/react-bootstrap-datetimepicker.min.js",
6+
],
7+
"ignore": []
8+
}

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
"repository": {
66
"type": "git",
77
"url": "http://github.com/quri/react-bootstrap-datetimepicker"
8-
}
8+
},
9+
"main": "./src/DateTimeField.jsx",
910
"scripts": {
10-
"build": "./node_modules/.bin/grunt build",
11+
"build": "NODE_ENV=production webpack --output-file react-bootstrap-datetimepicker.js",
12+
"build-min": "NODE_ENV=production COMPRESS=1 webpack --output-file react-bootstrap-datetimepicker.min.js",
1113
"examples": "webpack-dev-server --config ./examples/webpack.config.js",
1214
"test-watch": "./node_modules/.bin/grunt watch 2>&1 >/dev/null & karma start karma.dev.js",
1315
"test": "./node_modules/.bin/grunt build && karma start karma.ci.js"

webpack.config.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
var webpack = require('webpack');
2+
3+
var plugins = [
4+
new webpack.DefinePlugin({
5+
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
6+
})
7+
];
8+
9+
if (process.env.COMPRESS) {
10+
plugins.push(
11+
new webpack.optimize.UglifyJsPlugin({
12+
compressor: {
13+
warnings: false
14+
}
15+
})
16+
);
17+
}
18+
19+
module.exports = {
20+
21+
entry: ['./src/DateTimeField.jsx'],
22+
23+
output: {
24+
path: __dirname + "/dist/",
25+
library: 'react-bootstrap-datetimepicker',
26+
libraryTarget: 'umd',
27+
},
28+
29+
resolve: {
30+
extensions: ['', '.js', '.jsx']
31+
},
32+
33+
module: {
34+
loaders: [
35+
{ test: /\.jsx$/, loader: 'jsx-loader' }
36+
]
37+
},
38+
39+
plugins: plugins
40+
41+
};

0 commit comments

Comments
 (0)