Skip to content

Instantly share code, notes, and snippets.

@jasoncharnes
Created November 19, 2021 20:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasoncharnes/ea1de9096fb28d981a810b04c2f08ad0 to your computer and use it in GitHub Desktop.
Save jasoncharnes/ea1de9096fb28d981a810b04c2f08ad0 to your computer and use it in GitHub Desktop.
Using Parcel 2 with Rails and jsbundling-rails
{
"extends": "@parcel/config-default",
"resolvers": ["@parcel/resolver-glob", "..."]
}
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);
},
});
{
"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