-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make bundler middleware usage intuitive (#449)
* Make bundler middleware usage intuitive * Fix middleware test Specifically bundling `/commonjs/index.js` in the middleware test before running the `should produce two bundles when importing a CSS file` one seems to cause `bunde()` in the latter to throw.
- Loading branch information
1 parent
dc4acd8
commit b9004fc
Showing
4 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const assert = require('assert'); | ||
const {bundler} = require('./utils'); | ||
|
||
describe('bundler', function() { | ||
it('should bundle once before exporting middleware', function(done) { | ||
let b = bundler(__dirname + '/integration/bundler-middleware/index.js'); | ||
b.middleware(); | ||
|
||
setTimeout(() => { | ||
assert(b.mainAsset); | ||
done(); | ||
}, 300); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
var local = require('./local'); | ||
|
||
module.exports = function () { | ||
return local.a + local.b; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
exports.a = 1; | ||
exports.b = 2; |