webpack/examples/component/template.md

55 lines
961 B
Markdown
Raw Normal View History

2014-07-26 22:40:33 +08:00
This example demonstrates the usage of [component](https://github.com/component/component) built with webpack.
Components declare scripts and styles in a special `component.json` file. This file is handled by the plugin. In addition to that there is a different resolution algorithm for components.
You can see that the component-webpack-plugin handles these components including scripts, styles and other assets.
# example.js
``` javascript
{{example.js}}
```
# webpack.config.js
``` javascript
{{webpack.config.js}}
```
# component.json
``` javascript
{{component.json}}
```
2014-04-17 14:40:55 +08:00
# components/webpack-a-component/component.json
``` javascript
2014-04-17 14:40:55 +08:00
{{components/webpack-a-component/component.json}}
```
2014-04-17 14:40:55 +08:00
# components/webpack-a-component/style.css
2013-03-18 21:09:39 +08:00
``` css
2014-04-17 14:40:55 +08:00
{{components/webpack-a-component/style.css}}
```
# js/output.js
``` javascript
{{js/output.js}}
```
# Info
## Uncompressed
```
{{stdout}}
```
## Minimized (uglify-js, no zip)
```
{{min:stdout}}
```