@laheadle its a temlpate ๐
that fills in :output-to
with the :output-in options, and fills in :final-output-to
with output-to + โ_bundle.jsโ
Can't seem to figure it out.
oh you are trying to use it?
yes trying to pull in an npm module
@laheadle you skipped the :final-output-to after the โ-oโ
you can try the command on the command line
doh
trying the command on the command line after your initial compile is a good way to figure out any glitches in your set up
I have to head out but Iโll be available tomorrow if you have more questions
ok. Not sure which command I should try from the command line. I am running from the command line: clj -m figwheel.main --build dev
oh maybe webpack from command line
ok fixed webpack a bit
still getting :bundle-cmd :none failed
Ok found an error with clj -m figwheel.main --build-once dev
my npm dep needed react in package.json. seems to be working now.
I see I don't need to make my own webpack.config.js
Ok I've made a lot of progress. Currently trying to figure out how to get figwheel to tell webpack to export React as a global on window, so rum can refer to it using js/React.
I cannot believe how good the figwheel docs are. Seriously, so good. So complete. A pleasure to read. Almost like they were written by a Fun driven developer or something.
thanks!
Yeah rum needs to change the way it imports react
you can still use cljsjs/react in the meantime to support rum
or you can set! window[โReactโ] = react
I have yet to update the docs on using npm modules and webpack
Ok I am up and running. Thanks a million @bhauman
cool did you update an older project?
Yeah, I had a small one I started a few months ago.
This should improve the workflow
you can now just do npm add lib and use it
absolutely. 3rd party react hooks ecosystem is spread out before us like a buffet.
๐
also another thing you can do is run webpack on the command line with the -w flag after figwheel has launched
does figwheel create a webpack.config.js?
no
one isnโt needed if you are doing simple things
gotcha
I'm using firebase importing the npm package, this is what I have in index.js
import * as firebase from 'firebase/app';
import "firebase/analytics";
import 'firebase/auth';
import 'firebase/database';
window["firebase"] = firebase;
When I run the following code in advanced compilation I get an error saying firebase.database
is not a function (actually YG.pi
is not a function because the names were minified)
(ns myapp.firebase
(:require
[firebase]
))
(def firebase-db
(do
(when (= 0 (some-> firebase .-apps .-length))
(-> firebase (.initializeApp firebase-config)))
(-> firebase (.database))))
I'm thinking it might be because of the way I'm importing firebase. Any suggestions?@jpsoares106 yeah this is an externs problem
The good news is that this may be fixed with the new npm support in ClojureScript
Iโm intending to write a tutorial on how to use these new features on Monday
ha did you just push a change to the 0.2.6 snapshot, bruce? Seemed to fix a console warning about :after-hook
not being found :thinking_face: ๐
I did but I donโt know what would have caused that