-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I import global scss file in Vue? #1725
Comments
That will not inject it, it’ll create a new css bundle that would be added to an index.html if thats the entrypoint Sent with GitHawk |
Is there a way to import global scss style like webpack sass-resources-loader? And do you have any ideas for problem 2 above? Is it may be a bug? @DeMoorJasper Thanks. |
@Jancat If I understand correctly than the sass-ressources-loader is basically just sass-node but for webpack and we support every sass feature so I guess we support it... Not sure why that isn't working probably a good idea to dive into the output folder and see for yourself why it isn't working, some debugging from your side would definitely help. I can't guess what's going wrong |
@DeMoorJasper Sorry, the problem 2 is the reason that I forgot to add For problem 1: Since Parcel base on |
A few months passed. Is there a solution? I bring an example of how it is done in the Webpack.
|
+1 |
Place it inside your main.js |
it still doesn't work. I want to include Bootstrap scss and it simply doesn't work, I have tried countless combinations. You guys should stop announcing that parcel is a zero-config thing, because it is not. I'm going back to webpack |
This one was a bit of a blow to my initial Parcel excitement, but I'm sure we'll see an implementation soon. EDIT: After looking around for a bit, this solution has worked wonders for me. Just add .sassrc.js to your project root folder and link it with your entry point. Parcel Magic® takes care of the rest. .sassrc.js module.exports = { data: '@import "./src/styles";' }; |
Is there any way of doing the same with Stylus? This is the last thing I need to get working in Parcel before I can switch to it wholesale, because I need the ability to globally import my mixins and variables into every file. This is the webpack loader config I'm trying to reproduce:
|
@Neefay hi! what do you mean "link with your entry point"? |
@Neefay
From there you can It's a pity that you can't load .scss files from .vue files since I would have liked to make them scoped, but at least this is working. Edit: I should also mention I had to use |
I have tried a multitude of things, but this was something which actually worked. Thank you, @Neefay!! |
❔ Question
I'm building a Vue.js application and installed
node-sass
devDependency already.I want to import global scss file(main.scss) in
main.ts
and all.vue
component can use the global style directly. But it not works in the below code.The main.ts file:
App.vue
/styles/main.scss
problem:
.vue
component.<div id="app">
root element.🔦 Context
How to import scss into Vue application properly?
🌍 Your Environment
The text was updated successfully, but these errors were encountered: