Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

135
Views
How to correctly import scss files into VueJS project

I have component - Header.vue

Header:

<template>
  <div>
    <div class="header">

    </div>
  </div>
</template>

<script>
export default {
  name: "Header"
}
</script>

<style lang="scss">
@import "src/assets/styles/header";
</style>

As you can see, I am trying to import scss file called header, but it just doesn't work. In internet I found, that I had to install sass, node-sass and sass-loader but it didn't work for me. I still get error. What is the problem? With filename? Or should I import this file somewhere else?

P.S: Here is package.json, if it could be important:

{
  "name": "asd",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build"
  },
  "dependencies": {
    "core-js": "^3.6.5",
    "node-sass": "^6.0.1",
    "sass-loader": "^12.1.0",
    "vue": "^3.0.0"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "~4.5.0",
    "@vue/cli-service": "~4.5.0",
    "@vue/compiler-sfc": "^3.0.0"
  }
}
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Try like this:

@import "@/assets/styles/header.scss";
about 4 years ago · Juan Pablo Isaza Report

0

import '@/src/assets/styles/header.scss';

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!