Skip to content
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

binaryage/devtools compiled to min code #35

Closed
jinwei233 opened this issue Oct 1, 2016 · 2 comments
Closed

binaryage/devtools compiled to min code #35

jinwei233 opened this issue Oct 1, 2016 · 2 comments

Comments

@jinwei233
Copy link

jinwei233 commented Oct 1, 2016

core.cljs has some devtools code , min compile file size 580kb

I comment out devtools related code , min compile file size 340kb

(ns re-frame-app.core
    (:require [reagent.core :as reagent]
              [re-frame.core :as re-frame]
              ;; [devtools.core :as devtools]
              [re-frame-app.handlers]
              [re-frame-app.subs]
              [re-frame-app.views :as views]
              [re-frame-app.config :as config]))

;; (defn dev-setup []
;;   (when config/debug?
;;     (enable-console-print!)
;;     (println "dev mode")
;;     (devtools/install!)))

(defn mount-root []
  (reagent/render [views/main-panel]
                  (.getElementById js/document "app")))

(defn ^:export init []
  (re-frame/dispatch-sync [:initialize-db])
  ;; (dev-setup)
  (mount-root))

a better way to include devtools would be:

{:id           "dev"
     :source-paths ["src/cljs"]
     :figwheel     {:on-jsload "re-frame-app.core/mount-root"}
     :compiler     {:main                 re-frame-app.core
                    :preloads             [devtools.preload]
                    :external-config      {:devtools/config {:features-to-install :all}}
                    :output-to            "resources/public/js/compiled/app.js"
                    :output-dir           "resources/public/js/compiled/out"
                    :asset-path           "js/compiled/out"
                    :source-map-timestamp true}}
@gadfly361
Copy link
Contributor

gadfly361 commented Oct 5, 2016

@WeweTom Thanks!! I hadn't seen this before. I looked back at the cljs-devtools installation.md and I guess it is what is recommended there 😁 Will try to get this update in this week.

gadfly361 added a commit that referenced this issue Oct 9, 2016
- thank you @WeweTom for the gist;
@gadfly361
Copy link
Contributor

@WeweTom Thanks again! Just pushed out a fix for this using your gist :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants