mirror of https://github.com/status-im/reagent.git
Make site generation work with new cljs
This commit is contained in:
parent
767410d8d8
commit
60d99c44fe
4
Makefile
4
Makefile
|
@ -15,11 +15,11 @@ run: figwheel
|
|||
|
||||
# development build with auto-reloading and site generation
|
||||
runsite:
|
||||
@$(MAKE) run PROF=dev,site,$(PROF)
|
||||
@$(MAKE) run PROF=+site,$(PROF)
|
||||
|
||||
# development build with figwheel, but no tests
|
||||
runnotest:
|
||||
@$(MAKE) run PROF=dev-notest,$(PROF)
|
||||
@$(MAKE) run PROF=+dev-notest,$(PROF)
|
||||
|
||||
# production build with auto-rebuild
|
||||
runprod: clean
|
||||
|
|
|
@ -8,7 +8,9 @@ var run = function (src) {
|
|||
vm.runInThisContext(fs.readFileSync(src), src);
|
||||
}
|
||||
|
||||
var loadSrc = function (mainFile, outputDir, devModule) {
|
||||
var imported = {};
|
||||
|
||||
var loadSrc = function (mainFile, outputDir, devFile) {
|
||||
var googDir = path.join(outputDir, "goog");
|
||||
var optNone = false;
|
||||
if (outputDir) {
|
||||
|
@ -21,13 +23,16 @@ var loadSrc = function (mainFile, outputDir, devModule) {
|
|||
}
|
||||
global.CLOSURE_IMPORT_SCRIPT = function (src) {
|
||||
var s = path.resolve(path.resolve(cwd, path.join(googDir, src)));
|
||||
run(s);
|
||||
return true;
|
||||
if (!(s in imported)) {
|
||||
imported[s] = true;
|
||||
run(s);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
run(path.join(googDir, "base.js"));
|
||||
run(path.join(outputDir, "cljs_deps.js"));
|
||||
goog.require(devModule);
|
||||
run(path.join(outputDir, devFile));
|
||||
} else {
|
||||
run(mainFile);
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ var cljsLoad = require("./cljs-load");
|
|||
|
||||
var srcFile = "outsite/public/js/main.js";
|
||||
var outputDirectory = "outsite/public/js/out/";
|
||||
var moduleName = "reagentdemo.dev";
|
||||
var devFile = "reagentdemo/dev.js";
|
||||
|
||||
var beep = "\u0007";
|
||||
|
||||
|
@ -15,7 +15,7 @@ if (typeof location === "undefined") {
|
|||
|
||||
var gensite = function () {
|
||||
console.log("Loading " + srcFile);
|
||||
var optNone = cljsLoad.load(srcFile, outputDirectory, moduleName);
|
||||
var optNone = cljsLoad.load(srcFile, outputDirectory, devFile);
|
||||
sitetools.core.genpages({"opt-none": optNone});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue