Skip to content

Instantly share code, notes, and snippets.

@sgrove
Created September 10, 2015 15:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sgrove/3823db668c684cd6a214 to your computer and use it in GitHub Desktop.
Save sgrove/3823db668c684cd6a214 to your computer and use it in GitHub Desktop.
cljs + webpack interop sketch
;; Example config
:libs [;; Provides is what you would (:require [ReactMotion :as rm
;; and ends up as exports.ReactMotion
{:provides ["ReactMotion"]
:native-name ["react-motion"]
:preprocess :webpack
:webpack-options {. .}}
{:provides ["React"]
:native-name ["react"]
:preprocess :webpack
:webpack-options {. .}}]
;; The output of this would be an auto-generated (hash lib).js file like this:
;; var ReactMotion = require('react-motion')
;; var React = require('react')
;; exports.ReactMotion = ReactMotion
;; exports.React = React
;; Then webpack would combine all
;; of the libs into a single js
;; output file (with no
;; optimizations applied, just
;; dependency deduping, e.g. making
;; it loadable by the browser) that
;; would be included in cljs build process.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment