-
Notifications
You must be signed in to change notification settings - Fork 11
Use webpack-dev-middleware #11
Comments
Merci for your suggestions. But some of the points you've mentioned are rather features than restrictions. Let's get through it point by point:
If there is only one file, than you only have to include this one file. nof5 serves the bundle as
I'm not sure if this will be a real use case for client side unit tests.
If a change happened in the test or lib folder than this behavior is desired. But you're right if you say that not every test needs to be recompiled. On the other hand the recompilation of all tests is damn fast at the current state and no real issue.
nof5 watches the given folder or
|
I just want to say that you don't use webpack's full potential in some aspects. That's ok, but I've already have written a module which would care about above aspects. Webpack has watching integrated and there are already a middleware for express which cares about the im memory compliation and serving. You can use it, if you want to. var options = {
events: new EventEmitter(),
output: "tests.js"
};
options.events.on("bundle-invalid", function() {
// On file change, the bundle becomes invalid.
// We need to update the page
io.sockets.emit("f5");
});
// serve bundle and other emitted files
app.use(webpackDevMiddleware(testsLoader + "!" + testsLoader, options)); |
nof5 is written to support multiple bundlers like browserify and webpack. Maybe in future we'll decided to bake nof5 with webpack, like alamid. If so nof5 will surely make use of your suggested improvement here. But as you already mentioned
and at the moment nof5 is doing what it should to. I marked this issue as enhancement and attached it to milestone 0.3.0, so that it will be discussed for further releases. |
Yes it intended as (future) enhancement. It not to complicated, but i think it do not fit easily into the nof5 architecture, so I implemented it standalone: webpack-dev-server ;) |
Use the webpack-dev-middleware for serving a webpack bundle.
It may need some more refactoring...
Your current impl has some restrictions:
require('file/png!./resource.png')
The text was updated successfully, but these errors were encountered: