Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5ebeb1b

Browse files
committed
- Improved client-side bundling chapter
1 parentd6889ee commit5ebeb1b

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

‎README.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,28 @@ Since rewire relies heavily on node's require mechanism it can't be used on the
116116
###browserify
117117

118118
```javascript
119-
var b=browserify();
119+
var b=browserify(),
120+
bundleSrc;
121+
122+
// Add rewire as browserify middleware
123+
// @see https://github.com/substack/node-browserify/blob/master/doc/methods.markdown#busefn
120124
b.use(require("rewire").bundlers.browserify);
125+
126+
b.addEntry("entry.js");
127+
bundleSrc=b.bundle();
121128
```
122129

123130
###webpack
124131

125132
```javascript
126-
var options= {};
133+
var webpackOptions= {
134+
output:"bundle.js"
135+
};
136+
137+
// This function modifies the webpack options object.
138+
// It adds a postLoader and postProcessor to the bundling process.
139+
// @see https://github.com/webpack/webpack#programmatically-usage
140+
require("rewire").bundlers.webpack(webpackOptions);
127141

128-
require("rewire").bundlers.webpack(options);
142+
webpack("entry.js", webpackOptions,function () {});
129143
```

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp