Skip to content

Commit e0d1b8d

Browse files
author
Takeharu Oshida
committed
#2 Add webpack build config task
1 parent 4628de0 commit e0d1b8d

File tree

3 files changed

+40
-4
lines changed

3 files changed

+40
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
## Change Log
22

3-
### Ver 0.1.0 (Next Release)
3+
### Ver 0.1.2 (Next Release)
4+
5+
### Ver 0.1.1
6+
* [#2 Compile before publishing](https://github.com/georgeOsdDev/react-web-notification/issues/2)
47

58
### Ver 0.1.0 Initial release

package.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22
"name": "react-web-notification",
33
"version": "0.1.1",
44
"description": "React component with HTML5 Web Notification API",
5-
"main": "./components/Notification.js",
5+
"main": "./dist/ReactWebNotification.js",
66
"scripts": {
77
"browser": "browser-sync start --files example/* --server example",
88
"watch:example": "watchify example/app.js -dv -o example/bundle.js",
99
"start:example": "npm run watch:example & npm run browser",
1010
"test:local": "karma start",
11-
"test": "./node_modules/.bin/karma start --browsers Firefox --single-run"
11+
"test": "./node_modules/.bin/karma start --browsers Firefox --single-run",
12+
"clean": "rimraf dist",
13+
"build": "clean & webpack"
1214
},
1315
"repository": {
1416
"type": "git",
@@ -46,7 +48,11 @@
4648
"karma-spec-reporter": "0.0.19",
4749
"mocha": "^2.2.5",
4850
"sinon": "^1.14.1",
49-
"watchify": "^3.2.1"
51+
"watchify": "^3.2.1",
52+
"webpack": "^1.12.0",
53+
"babel-core": "^5.8.23",
54+
"babel-loader": "^5.3.2",
55+
"rimraf": "^2.4.3"
5056
},
5157
"dependencies": {
5258
"react": "^0.13.3"

webpack.config.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
var webpack = require('webpack');
2+
var path = require('path');
3+
4+
module.exports = {
5+
entry: './components/Notification.js',
6+
output: {
7+
filename: 'dist/ReactWebNotification.js',
8+
libraryTarget: 'umd',
9+
library: 'ReactWebNotification'
10+
},
11+
externals: [{
12+
react: {
13+
root: 'React',
14+
commonjs2: 'react',
15+
commonjs: 'react',
16+
amd: 'react'
17+
}
18+
}],
19+
module: {
20+
loaders: [
21+
{ test: /\.js$/, loader: 'babel', include: path.join(__dirname, 'components') }
22+
]
23+
},
24+
plugins: [
25+
new webpack.optimize.OccurenceOrderPlugin()
26+
]
27+
};

0 commit comments

Comments
 (0)