Skip to content

Commit

Permalink
fix(webpack): add image loader
Browse files Browse the repository at this point in the history
  • Loading branch information
egoist committed Feb 3, 2016
1 parent 202ac7e commit 70b6723
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 9 deletions.
6 changes: 6 additions & 0 deletions example/fixture.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,10 @@ html {
button {
padding: 100px;
}
.logo {
height: 60px;
width: 200px;
background-size: cover;
background-image: url(./tooling-logo.png);
}
}
7 changes: 6 additions & 1 deletion example/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ class Counter extends Component {
})
}
render() {
return <button onClick={this.handleClick.bind(this)}>{this.state.count}</button>
return (
<div>
<div className="logo"></div>
<button onClick={this.handleClick.bind(this)}>{this.state.count}</button>
</div>
)
}
}

Expand Down
Binary file added example/tooling-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions lib/webpack.config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ module.exports = function (type, options) {
test: /\.jsx?$/,
loaders: ['babel'],
exclude: [/node_modules/]
},
{
test: /\.(png|jpg|gif)$/,
loader: 'url?limit=1000&name=images/[hash].[ext]',
exclude: [/node_modules/]
}
]
},
Expand Down
23 changes: 15 additions & 8 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
# tooling

[![version](https://img.shields.io/npm/v/tooling.svg)](https://www.npmjs.com/package/tooling)
[![npm](https://img.shields.io/npm/dm/tooling.svg)](https://www.npmjs.com/package/tooling)
[![Travis branch](https://img.shields.io/travis/egoist/tooling/master.svg)](https://travis-ci.org/egoist/tooling)
[![Join the chat at https://gitter.im/egoist/tooling](https://badges.gitter.im/egoist/tooling.svg)](https://gitter.im/egoist/tooling?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
![extra](https://img.shields.io/badge/actively%20maintained-yes-ff69b4.svg)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
<p align="center">
<img src="example/tooling-logo.png" height="100"/>
</p>

<p align="center">
<a href="https://www.npmjs.com/package/tooling"><img src="https://img.shields.io/npm/v/tooling.svg" alt="version" style="max-width:100%;"></a>
<a href="https://www.npmjs.com/package/tooling"><img src="https://img.shields.io/npm/dm/tooling.svg" alt="npm" style="max-width:100%;"></a>
<a href="https://travis-ci.org/egoist/tooling"><img src="https://img.shields.io/travis/egoist/tooling/master.svg" alt="Travis branch" style="max-width:100%;"></a>
</p>

<p align="center">
<a href="https://gitter.im/egoist/tooling?utm_source=badge&amp;utm_medium=badge&amp;utm_campaign=pr-badge&amp;utm_content=badge"><img src="https://badges.gitter.im/egoist/tooling.svg" alt="Join the chat at https://gitter.im/egoist/tooling" style="max-width:100%;"></a>
<a href="" target="_blank"><img src="https://img.shields.io/badge/actively%20maintained-yes-ff69b4.svg" alt="extra" style="max-width:100%;"></a>
<a href="https://github.com/semantic-release/semantic-release"><img src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg" alt="semantic-release" style="max-width:100%;"></a>
</p>

## Technologies

Expand Down

0 comments on commit 70b6723

Please sign in to comment.