It implements a module for Duct.
hydrogen.module.core
brings in config for doing SPAs the Hydrogen way.
{:hydrogen.module/core {}}
And a more realistic example:
{:hydrogen.module/core
{:figwheel-main true
:externs-paths {:production ["src/my-app/client/externs.js"
"src/my-app/client/google_maps_api_v3_36.js"]
:development ["oksol/client/google_maps_api_v3_36.js"]}}}
As of version 0.2.0 this module supports new config syntax suitable for figwheel main.
Make sure to add :figwheel-main true
if you are using Figwheel-main.
:externs-paths
option. It accepts two formats:
{:externs-paths ["a.js" "b.js"]}
- this would apply both files as externs both in development environment
(as part of :duct.server/figwheel
config)
and in production environment
(as part of :duct.compiler/cljs
config).{:externs-paths {:production ["a.js"] :development ["x.js" "y.js"]}}
Figwheel expects files with .js extension inside its source directories to be a foreign library. And foreign libraries MUST declare a namespace. In fact, figwheel assumes it, and if it doesn't find it and can't map the file back to a source file, it bombs out with a NullPointerException.
So even if externs files are NOT foreign libraries, make sure you add a namespace declaration to your externs files to prevent figwheel from crashing.
Like this: goog.provide('google.maps');
Copyright (c) 2019 Magnet S Coop.
The source code for the library is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
Can you improve this documentation? These fine people already did:
James Reeves, Damian Hryniewicz & Iñaki ArenazaEdit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close