I'm trying to setup neutrino for my web project. Configuring it seems really easy and straightforward, however I can't get watch mode (start) to work at all and I have no idea why...
For testing I have a clean, test-only setup for neutrinojs 8.3.0 with minimal config and one simple index.js
file in the /src
folder. If I run yarn build
it works well, files are generated to the /build
directory as excepted (index, runtime, manifest), no errors.
But if I run yarn start
, and change something in index.js
, I can see the Source changed, re-compiling
message in terminal then √ Build completed
but none of the files in /build
were changed, hashes are the same they was before.
If I delete everything from /build
and run yarn start
again, it says again that √ Build completed
but the /build
dir is empty, no files generated.
I can't understand, it should just work. Did I miss something? Or is it a bug in neutrino or webpack 3.12.0? Should I create an issue?
I'm using VS Code which is not using "safe-write" so that's not an issue here... I've tried it on windows and linux, same for both.
src/index.js:
console.log('hello world');
.neutrinorc.js:
module.exports = {
use: [
['@neutrinojs/web', {
html: false
}]
]
};
package.json:
{
"name": "neutrino",
"version": "1.0.0",
"main": "src/index.js",
"license": "MIT",
"scripts": {
"start": "neutrino start",
"build": "neutrino build"
},
"devDependencies": {
"@neutrinojs/web": "^8.3.0",
"neutrino": "^8.3.0"
}
}
Neutrino under the hood uses webpack-dev-server which uses webpack-dev-middleware and as you can see on the first section of the
README
file:That is what is happening. Files are written into memory and webpack is able to serve them. That is why you can see your application.