Skip to content

Commit

Permalink
Add webpack build
Browse files Browse the repository at this point in the history
  • Loading branch information
Cédric Delpoux committed Jul 8, 2015
1 parent 0dd6b8c commit e26f7fd
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 14 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.0.4 - 2015-07-08

* Added: webpack build

## 1.0.3 - 2015-07-03

* Added: fixed tooltip example
Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ npm install --save react-simple-tooltip

See [changelog](./CHANGELOG.md)

## Demo

http://cedricdelpoux.github.io/react-simple-tooltip/

## Usage

### Examples
Expand Down Expand Up @@ -104,12 +108,6 @@ npm run clean
npm run build
```

### Watch `src` folder

```js
npm run watch
```

### Lint `src` folder

```js
Expand Down
23 changes: 15 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-simple-tooltip",
"version": "1.0.3",
"version": "1.0.4",
"description": "A lightweight and simple tooltip component for React",
"repository": {
"type": "git",
Expand All @@ -22,19 +22,26 @@
"lib"
],
"dependencies": {
"babel-runtime": "~5.6.4",
"classnames": "~2.1.2",
"react": "^0.13.1"
"react": "^0.13.3"
},
"devDependencies": {
"babel": "^5.4.5",
"babel-eslint": "^3.1.5",
"eslint": "^0.21.1",
"eslint-plugin-react": "^2.1.0"
"babel": "~5.6.14",
"babel-core": "~5.6.15",
"babel-eslint": "~3.1.20",
"babel-loader": "~5.1.4",
"css-loader": "~0.15.1",
"eslint": "~0.21.2",
"eslint-loader": "~0.14.0",
"eslint-plugin-react": "~2.6.4",
"node-libs-browser": "~0.5.2",
"style-loader": "~0.12.2",
"webpack": "~1.10.1"
},
"scripts": {
"clean": "rm -rf lib",
"build": "babel src --out-dir lib --copy-files",
"watch": "npm run build -- --watch",
"build": "webpack --progress --colors --display-modules",
"lint": "eslint src/",
"prepublish": "npm run clean && npm run build"
}
Expand Down
37 changes: 37 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
var webpack = require('webpack')
var path = require('path')

var sources = [
path.resolve(__dirname, 'src'),
]

module.exports = {
entry: './src/index.js',
output: {
path: __dirname,
filename: './lib/index.js',
},
resolve: {
extensions: ['', '.js', '.css']
},
module: {
preLoaders: [
{ test: /\.js?$/, include: sources, loader: 'eslint' },
],
loaders: [
{ test: /\.js$/, include: sources, loader: 'babel' },
{ test: /\.css$/, include: sources, loader: 'style!css' },
],
},
plugins: [
new webpack.NoErrorsPlugin(),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.AggressiveMergingPlugin(),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false,
},
}),
]
}

0 comments on commit e26f7fd

Please sign in to comment.