Skip to content

Commit ce44b23

Browse files
committed
Document using locally
Fixes #2 🎉
1 parent f1355ec commit ce44b23

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

README.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Install the loader using [npm](https://npmjs.com/):
1212
npm install --save ify-loader
1313
```
1414

15-
You can then update your `webpack.config.js` in a similar fashion to the following to add browserify transform support to your project:
15+
You can then update your `webpack.config.js` in a similar fashion to the following to add browserify transform support to your project's dependencies:
1616

1717
``` javascript
1818
module.exports = {
@@ -29,6 +29,42 @@ module.exports = {
2929
}
3030
```
3131

32+
### Using transforms in your project
33+
34+
Note that you're also free to apply this loader to files in your own project. Include the following in your project's `webpack.config.js`:
35+
36+
``` javascript
37+
module.exports = {
38+
module: {
39+
postLoaders: [
40+
// support local package.json browserify config
41+
{
42+
test: /\.js$/,
43+
loader: 'ify'
44+
}
45+
]
46+
}
47+
}
48+
```
49+
50+
Any browserify transforms you include in `package.json` will get picked up and applied this way:
51+
52+
``` json
53+
{
54+
"name": "my-project",
55+
"dependencies": {
56+
"glslify": "5.0.0",
57+
"brfs": "1.4.2"
58+
},
59+
"browserify": {
60+
"transform": [
61+
"glslify",
62+
"brfs"
63+
]
64+
}
65+
}
66+
```
67+
3268
## Why?
3369

3470
When given the choice, I lean more in favour of [browserify](http://browserify.org) for its simplicity and compatability with node.js — however from time to time I need to work on projects that use webpack. The thing I run into issues with most often when switching between the two is the difference in how webpack handles source transforms compared to browserify.

0 commit comments

Comments
 (0)