Comments (11)
@zjhiphop Check out the docs for sass-loader
. You'll need to add a loader for SCSS to use SCSS in their own files, outside of components. The only difference is that instead of the style
loader, you'll use vue-style
. Let me know how that works out for you. 😃
from webpack.
@zjhiphop Just checking in. Have you had a chance to see if the suggestion above worked for you?
from webpack.
I am trying to do this literally right now - saw your last comment pop up in real time!
If you can help with an example snippet that would be helpful. I'm trying to do:
require('src/assets/scss/main.scss')
inside my App.vue component
from webpack.
I actually might be on the right track here already, added the following to my webpack.base.conf.js
file in the loaders
array (although getting other unrelated errors so I can't quite confirm):
{
test: /\.scss$/,
loaders: ["css", "sass"]
},
from webpack.
@chrispappas Almost. I believe this would be what you want:
{
test: /\.scss$/,
loaders: [ 'vue-style', 'css', 'sass' ]
}
from webpack.
Nice, I had actually added the stock style-loader and prepended style
to the loaders array, which seems to work great. Should I replace it with vuejs/vue-style-loader
instead? This seems to work just fine for my purposes at this point with the stock style-loader
plugin.
from webpack.
@yyx990803 forked style-loader
to fix some issues with it. I don't know a lot about that - I've just always used vue-style-loader
and never had issues. 😃 Evan will be able to better explain the history behind that decision and whether it matters for you in this case.
from webpack.
I forked it to provide better source map support for injected style tags during development, but other than that they are largely the same.
from webpack.
Thanks for the help guys, much appreciated.
from webpack.
@chrispappas Excellent. Even though this is resolved, I want to keep the issue open for now. I'm considering implementing something similar to this, so that CSS preprocessor files just automatically work if the loader is installed, similar to how they do in components.
from webpack.
Resolved in #84.
from webpack.
Related Issues (20)
- I run this new project,but this show nothing in IE 11,can you solve the problem?
- r 403 forbidden
- Actually, you could overwrite `publicPath` in `ExtractTextPlugin` as you want. HOT 1
- HMR with express server with NodeJS API
- When load image via binding attribute, scss error occure.
- The vue project is configured with babel-polyfill but still displays a blank page in ie
- Updated Webpack 2 to 4 and faced issues while building for production
- webpack test fails because of import export error!!!
- Vuetify : "Expected newline." loading vuetify sass files HOT 1
- Laravel Vue templates won't update on shared hosting!
- npm err unexpected end of json input while parsing near '... RE----\r\n"}},"1.2.0' HOT 1
- how i solve this HOT 2
- Build error related to "@import" of styles HOT 1
- Can`t use prod.env.js variable in proxy config
- Error: Can't resolve '@fontawesone/fontawesone-free/css/all.css' in 'D:\xamppp\htdocs\laravel\laravel\VeuDemo\login1\login1\src\plugins'
- set default assetsPublicPath to './' instead of '/'
- npm ERR! Unexpected end of JSON input while parsing near '.../registry.npmjs.org/v'
- Using VueJs in .Net MVC. everything compiles fine but i am getting an empty view
- > > I run this is the console of my navigator (Chrome), and no error message anymore :
- how to fix npm run build blank display with vue-cli 3.2.45
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 webpack.