Skip to content

Commit

Permalink
get rid of no-bundle as default and use +bundle as npm switch
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruce Hauman committed Jun 14, 2021
1 parent 67f22f5 commit 04b527a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -14,7 +14,7 @@ Make sure you have the [latest version of leiningen installed](https://github.co
--react Adds a bare bones React app, including Sablono.
--reagent Adds a bare bones Reagent app.
--rum Adds a bare bones Rum app.
+no-bundle Generates a project without npm and webpack support.
+bundle Generates a project with npm and webpack support.

Include the options using `--` to separate them from Leiningens
options, like so
Expand Down
2 changes: 1 addition & 1 deletion project.clj
@@ -1,4 +1,4 @@
(defproject figwheel/lein-template "0.5.20-4"
(defproject figwheel/lein-template "0.5.20-5"
:description "A Leinigen template for figwheel"
:url "https://github.com/bhauman/figwheel-template"
:license {:name "Eclipse Public License"
Expand Down
6 changes: 3 additions & 3 deletions src/leiningen/new/figwheel.clj
Expand Up @@ -47,7 +47,7 @@

(def framework-opts (set (map #(str "--" %) supported-frameworks)))

(def supported-attributes #{"no-bundle"})
(def supported-attributes #{"bundle"})

(def attribute-opts (set (map #(str "+" %) supported-attributes)))

Expand Down Expand Up @@ -84,7 +84,7 @@
--react which adds a minimal Ract application in core.cljs
--reagent which adds a minimal Reagent application in core.cljs
--rum which adds a minimal Rum application in core.cljs
+no-bundle don't include npm bundle support
+bundle include npm bundle support
Only one option can be specified at a time. If no option is specified,
nothing but a print statment is added in core.cljs"
[name & opts]
Expand All @@ -94,7 +94,7 @@
(str "Cannot name a figwheel project \"figwheel\" the namespace will clash.\n"
"Please choose a different name, maybe \"tryfig\"?")))
(let [{:keys [framework attributes]} (parse-opts opts)
bundle? (not (get attributes :no-bundle))
bundle? (get attributes :bundle false)
data {:name name
:sanitized (name-to-path name)
:react? (= :react framework)
Expand Down

0 comments on commit 04b527a

Please sign in to comment.