Hello,
I’ve reviewed some of the tutorials on removing certain bootstrap css and js files but the bower.son file doesn’t reflect the tutorials. Also removing the link to the bower scss files in main.scss makes no difference to injecting it within the css.
Can anyone let me know the standard practice on sage 8.5 for removing unused css/js.
Thanks, Stephen
cfx
November 18, 2016, 4:11pm
3
This has been covered many times throughout the forum. If you’re getting stuck on a particular step then please elaborate and be specific. Thank you!
Hello, I was using the purchased sage video for reference. What was suggested is to paste and remove unused components within the bower.son file within the overrides.
Yet in 8.5 we just have.
“dependencies”: {
“bootstrap”: “git://github.com/twbs/bootstrap.git#v4.0.0-alpha.4”
}
I did search the forum but couldn’t find a definitive answer. Do I just need to add an override section within bower.json?
All I need to do is remove several bootstrap scss and js files from the build.
Kind regards, Stephen
ben
November 18, 2016, 8:21pm
5
Yup, sorry about the confusion! With Sage 8.5.0 we removed the default overrides
with the switch to Bootstrap 4. You can reference an older version of Sage 8 to see an example:
"overrides": {
"bootstrap-sass": {
"main": [
"./assets/stylesheets/_bootstrap.scss",
"./assets/javascripts/bootstrap/transition.js",
"./assets/javascripts/bootstrap/alert.js",
"./assets/javascripts/bootstrap/button.js",
"./assets/javascripts/bootstrap/carousel.js",
"./assets/javascripts/bootstrap/collapse.js",
"./assets/javascripts/bootstrap/dropdown.js",
"./assets/javascripts/bootstrap/modal.js",
"./assets/javascripts/bootstrap/tooltip.js",
"./assets/javascripts/bootstrap/popover.js",
"./assets/javascripts/bootstrap/scrollspy.js",
"./assets/javascripts/bootstrap/tab.js",
"./assets/javascripts/bootstrap/affix.js",
"./assets/fonts/bootstrap/glyphicons-halflings-regular.eot",
"./assets/fonts/bootstrap/glyphicons-halflings-regular.svg",
"./assets/fonts/bootstrap/glyphicons-halflings-regular.ttf",
"./assets/fonts/bootstrap/glyphicons-halflings-regular.woff",
This file has been truncated. show original
Thanks Ben,
I’m using Materialize and added the overrides in. The only thing it’s now excluded the JS in the build. I’ve added a reference to the js but it’s still not compiling the js. The CSS is ok. Please see below an example.
“overrides”: {
“materialize”: {
“main”: [
"./bower_components/materialize/js/global.js", Not compiling
"./bower_components/materialize/sass/components/global",
"./bower_components/materialize/sass/components/icons-material-design",
"./bower_components/materialize/sass/components/grid",
"./bower_components/materialize/sass/components/navbar",
"./bower_components/materialize/sass/components/cards",
"./bower_components/materialize/sass/components/toast",
"./bower_components/materialize/sass/components/tabs",
"./bower_components/materialize/sass/components/tooltip",
"./bower_components/materialize/sass/components/buttons",
"./bower_components/materialize/sass/components/dropdown",
"./bower_components/materialize/sass/components/waves",
"./bower_components/materialize/sass/components/modal",
"./bower_components/materialize/sass/components/collapsible",
"./bower_components/materialize/sass/components/chips",
"./bower_components/materialize/sass/components/materialbox",
"./bower_components/materialize/sass/components/forms/forms",
"./bower_components/materialize/sass/components/table_of_contents",
"./bower_components/materialize/sass/components/sideNav",
"./bower_components/materialize/sass/components/preloader",
"./bower_components/materialize/sass/components/slider",
"./bower_components/materialize/sass/components/carousel",
"./bower_components/materialize/sass/components/date_picker/default",
"./bower_components/materialize/sass/components/date_picker/default.date",
"./bower_components/materialize/sass/components/date_picker/default.time"
]
}
cfx
November 24, 2016, 6:50pm
8
I went through literally every step to accomplish what you’re doing right here .
2 Likes