From 64220ea619eb70eb720d29b456ab9b04bf8b04d3 Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Sat, 31 Mar 2018 02:37:23 +0200 Subject: Make some dependencies optional. --- build.gradle | 3 --- npm.dependencies | 3 +++ src/main/kotlin/pl/treksoft/kvision/KVManager.kt | 11 ++++++++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index d464ff92..f8a24c24 100644 --- a/build.gradle +++ b/build.gradle @@ -76,9 +76,6 @@ kotlinFrontend { dependency("snabbdom", "0.7.1") dependency("snabbdom-virtualize", "0.7.0") dependency("navigo", "7.0.0") - dependency("jquery-resizable-dom", "0.28.0") - dependency("handlebars", "4.0.11") - dependency("handlebars-loader") npmdeps.eachLine { line -> def (name, version) = line.tokenize(" ") dependency(name, version) diff --git a/npm.dependencies b/npm.dependencies index 42efc32d..4f4fe417 100644 --- a/npm.dependencies +++ b/npm.dependencies @@ -6,7 +6,10 @@ bootstrap-datetime-picker 2.4.4 bootstrap-touchspin 3.1.1 font-awesome 4.7.0 font-awesome-webpack 0.0.5-beta.2 +jquery-resizable-dom 0.28.0 awesome-bootstrap-checkbox 0.3.7 trix 0.11.1 element-resize-event 2.0.9 bootstrap-fileinput 4.4.7 +handlebars 4.0.11 +handlebars-loader 1.7.0 diff --git a/src/main/kotlin/pl/treksoft/kvision/KVManager.kt b/src/main/kotlin/pl/treksoft/kvision/KVManager.kt index ee7b2d43..1d1a3dc7 100644 --- a/src/main/kotlin/pl/treksoft/kvision/KVManager.kt +++ b/src/main/kotlin/pl/treksoft/kvision/KVManager.kt @@ -134,10 +134,15 @@ internal object KVManager { require("bootstrap-fileinput/themes/explorer-fa/theme.min.js") } catch (e: Throwable) { } - - private val resizable = require("jquery-resizable-dom") + private val resizable = try { + require("jquery-resizable-dom") + } catch (e: Throwable) { + } + private val handlebars = try { + require("handlebars/dist/handlebars.runtime.min.js") + } catch (e: Throwable) { + } internal val fecha = require("fecha") - private val handlebars = require("handlebars/dist/handlebars.runtime.min.js") private val sdPatch = Snabbdom.init( arrayOf( classModule, attributesModule, propsModule, styleModule, -- cgit