I am trying to require a JS component in the path ./componnts/Foo.js of my project and no matter what I try js/require always gets nil. @joshmiller I sqw your template uses requires stuff from js path but I cant figure our how that even works hahaha. I am not using your template I wanted to start a fresh project with newer libs and thought I could reverse engineer some of shat you do in your template I am stumped.
@kidpollo Are you using Krell?
The paths for that are a little bit non-intuitive and it took me a while to figure it out. What happens is Krell generates a file called target/krell_npm_deps.js where it requires everything it found in your cljs files. It looks like this:
module.exports = {
krellNpmDeps: {
"../js/src/Icons.js": require('../js/src/Icons.js'),
"../js/src/SafeBackground.js": require('../js/src/SafeBackground.js'),
"../js/src/AddPlace.js": require('../js/src/AddPlace.js'),
Yes krell
Sorry I did not mention that haha
So the path when you do (js/require) needs to be relative to there. I keep my JS files in a top-level js/ directory, so they all look like (js/require "../js/src/Icons.js") regardless of where in the directory tree they live.
Hmm yea I saw that file and it Definitely does not include my files
Hm, in that case it might not be the path, but that Krell isn’t finding it on its compiler pass… What does the js/require form look like? I have noticed it needs to be a .js file for example, Krell isn’t looking for .jsx
I’ve tried all the forms hahaha
So it happens at first pass of compiler? Do I need to restart the repl every time I add a new one?
Yeah, I don’t believe it’ll hot reload.
Interesante
It’s part of the setup Krell does to get the whole environment together. You can see when it happens by just seeing when that krell_npm_deps.js file is touched.
Ok that gives some stuff to check! Thanks @joshmiller we should have a meet up again :D
Im Paco Jajaj just noticed my name is not here
Yes definitely! I need to check with Puppet to see if they’ll still host. And yeah, recognized the avatar heh.
:)
yup it works the problem is I was testing my requires post compile. It wasnt clear to me :S