Comments (11)
So I have switched to bootstrap-loader and sass-resources-loader.
I now have a file called variables.scss
referenced in webpack.config.js
in sassResources
which contains:
@import './pre-customizations.scss';
@import '../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/_variables.scss';
@import './customizations.scss';
This works well.
from bootstrap-sass-loader.
Hi @vjpr If you have one sass file, then so long as you defined the variable, you can see it.
By this, I mean, you need to put your sass in this config (name the file as you please). Then you can see all the bootstrap mixins, variables, etc.
mainSass: "./main.scss", // path to your main SASS file (optional)
from bootstrap-sass-loader.
I have a lots of sass files and they are required individually using webpack. I just want to import the variables. Sounds like it's not possible?
from bootstrap-sass-loader.
Hi @vjpr, that's not the way that sass works.
from bootstrap-sass-loader.
It's how webpack loaders work. Each file is compiled into css. Then it is appended to the header in a style tag.
The way I am thinking is importing the bootstrap variables. Then importing the precustomization file with my modifications to the variables. Then I can access the variables.
from bootstrap-sass-loader.
@vjpr we're changing the way we're doing the assets parts as shown here: https://github.com/shakacode/react-webpack-rails-tutorial/
See our npm "sass-resources-loader"...
We'll have some more docs on this in the next couple of weeks.
The sass-resources loader will prepend any common definition files, which sounds like what you want!
from bootstrap-sass-loader.
@vjpr bootstrap-loader
+ sass-resources loader
will solve it.
from bootstrap-sass-loader.
@vjpr Great, glad it helped 👍
from bootstrap-sass-loader.
After looking high and low for a solution, sass-resources-loader
did it. Might be worthwhile to add a note in the bootstrap-loader
README. 👍
from bootstrap-sass-loader.
@damassi Any chance that you can give us a PR note to the README.md. @alexfedoseev and I would super appreciate it! We're slammed with our new product release.
from bootstrap-sass-loader.
Will do.
EDIT: Just noticed that it is there, but that I missed it. Thanks!
from bootstrap-sass-loader.
Related Issues (20)
- Cannot load files... HOT 4
- File to import not found or unreadable with sass-loader 1.0.3 HOT 9
- @import scss file hot reload HOT 2
- 1.0.7 ERROR: Could not find path to config.bootstrapCustomizations HOT 3
- How to debug when HMR stops working? HOT 4
- Weird relative path behaviour HOT 8
- Placeholder for Bootstrap 4.0 HOT 15
- getting it to work HOT 2
- how do i include bootswatch customizations for _variables and _bootswatch? HOT 5
- extract text plugin HOT 3
- Add global wrapper for CSS Modules HOT 1
- Loading only bootstrap styles HOT 6
- "1.a Complete Bootstrap" not working for me HOT 2
- Feature request: Ability to turn off scripts and dependency on jquery HOT 2
- Migration to bootstrap-loader HOT 1
- bootstrap-sass-loader with eslint-loader HOT 2
- Unable to parse fonts HOT 1
- Style loader class name spaced HOT 1
- t
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bootstrap-sass-loader.