Created
November 19, 2021 20:00
-
-
Save jasoncharnes/ea1de9096fb28d981a810b04c2f08ad0 to your computer and use it in GitHub Desktop.
Using Parcel 2 with Rails and jsbundling-rails
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
{ | |
"extends": "@parcel/config-default", | |
"resolvers": ["@parcel/resolver-glob", "..."] | |
} |
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
import { render } from "react-dom"; | |
import { createInertiaApp } from "@inertiajs/inertia-react"; | |
import * as pages from "./Pages/*"; | |
createInertiaApp({ | |
resolve: (name) => pages[`${name}.jsx`], | |
setup({ el, App, props }) { | |
render(<App {...props} />, el); | |
}, | |
}); |
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
{ | |
"name": "app", | |
"private": "true", | |
"scripts": { | |
"build": "parcel app/javascript/application.js --dist-dir app/assets/builds --port 1234 --hmr-port 1235 --no-source-maps" | |
}, | |
"dependencies": { | |
"@inertiajs/inertia": "^0.10.1", | |
"@inertiajs/inertia-react": "^0.7.1", | |
"react": "^17.0.2", | |
"react-dom": "^17.0.2" | |
}, | |
"devDependencies": { | |
"@parcel/resolver-glob": "^2.0.0", | |
"parcel": "^2.0.0", | |
"prettier": "2.4.1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment