diff --git a/re-natal.coffee b/re-natal.coffee index baf44cd..35e6ebb 100644 --- a/re-natal.coffee +++ b/re-natal.coffee @@ -27,6 +27,7 @@ interfaceDepsRx = /\$INTERFACE_DEPS\$/g devProfilesRx = /\$DEV_PROFILES\$/g prodProfilesRx = /\$PROD_PROFILES\$/g platformRx = /\$PLATFORM\$/g +platformCleanRx = /\$PLATFORM_CLEAN\$/g devHostRx = /\$DEV_HOST\$/g ipAddressRx = /^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$/i figwheelUrlRx = /ws:\/\/[0-9a-zA-Z\.]*:/g @@ -377,7 +378,8 @@ copyProjectClj = (interfaceName, projNameHyph) -> fs.copySync("#{resources}/project.clj", "project.clj") deps = interfaceConf[interfaceName].deps.join("\n") - edit 'project.clj', [[projNameHyphRx, projNameHyph], [interfaceDepsRx, deps], [devProfilesRx, devProfiles.join("\n")], [prodProfilesRx, prodProfiles.join("\n")]] + cleans = platforms.map (platform) -> "\"index.#{platform}.js\"" + edit 'project.clj', [[projNameHyphRx, projNameHyph], [interfaceDepsRx, deps], [platformCleanRx, cleans.join(' ')], [devProfilesRx, devProfiles.join("\n")], [prodProfilesRx, prodProfiles.join("\n")]] init = (interfaceName, projName) -> if projName.toLowerCase() is 'react' or !projName.match validNameRx diff --git a/resources/project.clj b/resources/project.clj index 6db4b92..f463105 100644 --- a/resources/project.clj +++ b/resources/project.clj @@ -8,7 +8,7 @@ $INTERFACE_DEPS$] :plugins [[lein-cljsbuild "1.1.4"] [lein-figwheel "0.5.8"]] - :clean-targets ["target/" "index.ios.js" "index.android.js"] + :clean-targets ["target/" $PLATFORM_CLEAN$] :aliases {"prod-build" ^{:doc "Recompile code with prod profile."} ["do" "clean" ["with-profile" "prod" "cljsbuild" "once"]]}