From a6049ec383f313f448431d2e55173178927eead1 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Sun, 21 Aug 2016 18:53:59 +1200 Subject: [PATCH] FIX: Use chosen from npm package. Downloading the package from github makes npm install a lot slower and complicates the webpack build. --- admin/client/src/bundles/lib.js | 8 +------- admin/client/src/styles/_chosen.scss | 6 +----- admin/client/src/styles/bundle.scss | 3 +++ package.json | 2 +- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/admin/client/src/bundles/lib.js b/admin/client/src/bundles/lib.js index 09bf877cb..b773509f1 100644 --- a/admin/client/src/bundles/lib.js +++ b/admin/client/src/bundles/lib.js @@ -56,6 +56,7 @@ require('../../../../client/src/legacy/TabSet.js'); require('../legacy/ssui.core.js'); require('../../../../client/src/legacy/GridField.js'); require('json-js'); +require('chosen-js'); require('expose?SilverStripeComponent!lib/SilverStripeComponent'); require('expose?Backend!lib/Backend'); @@ -81,12 +82,5 @@ require('expose?ReactRouteRegister!lib/ReactRouteRegister'); require('expose?Injector!lib/Injector'); require('expose?Router!lib/Router'); -// Chosen is manually compiled from its support files -// Loaded into global state as I don't know how to chain the exports loader into the argument -// of the imports loader -require('expose?AbstractChosen!exports?AbstractChosen!chosen/coffee/lib/abstract-chosen.coffee'); -require('expose?SelectParser!exports?SelectParser!chosen/coffee/lib/select-parser.coffee'); -require('chosen/coffee/chosen.jquery.coffee'); - // Ensure that styles are built as part of this webpack bundle require('../styles/bundle.scss'); diff --git a/admin/client/src/styles/_chosen.scss b/admin/client/src/styles/_chosen.scss index d57159fb5..69fe6417e 100644 --- a/admin/client/src/styles/_chosen.scss +++ b/admin/client/src/styles/_chosen.scss @@ -1,5 +1 @@ -$chosen-sprite: url("../images/chosen-sprite.png"); -$chosen-sprite-retina: url("../images/chosen-sprite@2x.png"); - -@import "../../../../client/src/styles/_compasscompat"; -@import "../../../../node_modules/chosen/sass/chosen"; +@import "../../../../node_modules/chosen-js/chosen.css"; diff --git a/admin/client/src/styles/bundle.scss b/admin/client/src/styles/bundle.scss index 7c0f58d60..2efa58b96 100644 --- a/admin/client/src/styles/bundle.scss +++ b/admin/client/src/styles/bundle.scss @@ -1,6 +1,9 @@ // Variables @import "variables"; +// Compatibilty with compass +@import "../../../../client/src/styles/_compasscompat"; + // Thirdparty @import "chosen"; @import "../../../../node_modules/bootstrap/scss/bootstrap"; diff --git a/package.json b/package.json index cff7d40ee..b103d7ad7 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "blueimp-file-upload": "^6.0.3", "blueimp-load-image": "^1.1.3", "blueimp-tmpl": "^1.0.2", - "bootstrap": "4.0.0-alpha.2", + "bootstrap": "^4.0.0-alpha.2", "chosen-js": "^1.5.1", "deep-equal": "^1.0.1", "deep-freeze-strict": "^1.1.1",