I am trying out parcel bundler and with help from other people online have produced the following repository:
https://github.com/markwylde/parcel-react-demo
It's a working one page example app that builds successfully using react.
However when I do parcel watch ./src/index.html or parcel ./src/index.html and then change a file, it's not actually rebuilding anything.
This was just one of a few other problems I've been having. In general parcel just seems very buggy and is throwing a lot of errors. But I will submit that it could just be react specific stuff, or the fact I have never used parcel before.
I have uploaded a video of my experience to youtube.
.babelrc:
{
"presets": ["react"]
}
package.json:
{
"name": "egr",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"node-sass": "^4.9.1",
"react": "^16.4.1",
"react-dom": "^16.4.1"
},
"devDependencies": {
"babel-core": "^6.26.3",
"babel-preset-react": "^6.24.1"
}
}
I expect the dist folder to be updated when I change a source file.
When I change a source file the dist folder is not updating.
No idea, I've only just started looking into parcel today.
With 7 second build times it would be impossible to use this for an actual project.
https://github.com/markwylde/parcel-react-demo
| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 1.9.4 |
| Node | v10.3.0 |
| npm/Yarn | 6.1.0 |
| Operating System | macOS High Sierre |
@markwylde It took me a while to figure out what's going on with this issue. It turns out to be a typo in your code. In your index.js, it should be
import App from './Pages/App'
rather than
import App from './pages/App'
in order to map to the correct path to App.js. Otherwise any change in App.js cannot be properly detected.
@DeMoorJasper FYI.
Awesome @buronnie, thanks for your fast response. How embarrassing it was something so silly on my part. I have changed the case and it works perfectly now.
Great, closing this then. Feel free to reopen issues if you have other problems
Most helpful comment
@markwylde It took me a while to figure out what's going on with this issue. It turns out to be a typo in your code. In your
index.js, it should berather than
in order to map to the correct path to
App.js. Otherwise any change inApp.jscannot be properly detected.@DeMoorJasper FYI.