-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React Guide? #19
Comments
It's possible to use |
jsx is a supported file extension. you just need to setup babel in your project by adding a |
this is my existing .babelrc
:-\ |
Hi @NullVoxPopuli |
Is there an examples repo/document somewhere to put examples so new starters can find them easily / understand what is needed to get parcel to work in their stack? |
Another example is here https://github.com/jaredpalmer/react-parcel-example |
I'm thinking of adding a "recipes" section or something to the docs, for e.g. react and other common frameworks. Might be something someone could countribute :) |
Just chiming in that a react example with hot reloading would be super neat since that is the only thing that the competition ( |
Hot reloading would be neat! 😄 |
This is my first test with Parcel, React and hot-reload altogether: I am not so sure about what I did here, because:
I may have messed a bit with it. |
Nice work @albinotonnina! Want to write up a small tutorial for the Parcel website with some code and explanations? The pages are just markdown files here: https://github.com/parcel-bundler/website. |
@devongovett I would like to. My solution smells a bit though! Let me see if I can do better |
I wrote a guide on how to create a minimal React app using Parcel. |
@webular is having the same issue in #56… his example looks a lot more minimal |
I figured out why @NullVoxPopuli is getting this bug!!! The It’s not a problem with Parcel There are 2 trailing commas which cause {
"presets": [
"env",
"stage-0",
“react” ,<—————HERE (unnecessary comma)
],
"plugins": [
"transform-decorators-legacy",
"transform-runtime"
],
"env": {
"production": {
"plugins": [
["babel-plugin-remove-attribute", {
“attribute”: “data-test” ,<—————HERE (unnecessary comma)
}]
]
}
}
} Here’s the corrected version: {
"presets": [
"env",
"stage-0",
"react"
],
"plugins": [
"transform-decorators-legacy",
"transform-runtime"
],
"env": {
"production": {
"plugins": [
["babel-plugin-remove-attribute", {
"attribute": "data-test"
}]
]
}
}
} Try to use the corrected |
We need to add a try/catch around the |
@jakoblind nice work! Want to make a PR to https://github.com/parcel-bundler/website with that guide? Would be nice to have an additional section about setting up hot module reloading with react-hot-loader as well. |
@devongovett should I put my solution? Would you have a look at it again? |
Moving to #15 |
@thejameskyle How does this issue have anything to do with #15??? They are completely different issues!!! |
It was a typo, calm down. |
oh haha, that explains it... |
@davidnagli |
I made a PR to handle JSON5 #256 |
Unify loader runtimes Approved-by: Maia Teegarden
I tried
parcel index.jsx
it gave:granted, it's not a valid html file.
the file I currently use with webpack is linked via script tag to webpack's output js.
I tried using a script tag to my jsx entrypoint, but that didn't work either.
This was just with the default install, and 0 config.
The text was updated successfully, but these errors were encountered: