Questions tagged [sass-loader]
435 questions
0
votes
1 answer
Sass-loader not resolving import correctly if other type file exists with same name
I am using webpack 4 with angular 5 and using sass-loader to convert scss files to css.
I have a scss file (eg main.scss) which imports another scss file eg foo.scss like this:
@import "foo";
and i also have foo.ts file
sass loader is giving error…

Usman Aziz
- 131
- 1
- 5
0
votes
0 answers
Use Webpack to compile .sass - which way is faster?
We have a single index.scss file that @import all other scss files in our project. Currently, we use node-sass-chokidar(Libsass core) to compile index.scss to index.css every time we build the project.
I wonder would the process be faster or slower…

PhoenixPan
- 536
- 7
- 19
0
votes
1 answer
Error: No PostCSS Config found in '/home/react-project/workarea/scss'
I am trying to load scss files in my reactjs app using webpack. Here is my webpack code:
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader'
},
},
{
test: /\.(sa|sc|c)ss$/,
…

Vinayak humberi
- 191
- 3
- 8
0
votes
1 answer
Cannot override sass variables
I am using library 'keen-ui' in my project. That lib uses sass, to define styles. I want to override this styles. I connected sass loader to my project and it works fine, but problem is that sass loader loads my file 'variables.scss' before standard…

Fairy
- 509
- 1
- 9
- 27
0
votes
1 answer
extract-text-plugin not working with Webpack 3
My webpack.config.js:
const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: [
'./src/index.js',
'react-hot-loader/patch',
],
module: {
…

darKnight
- 5,651
- 13
- 47
- 87
0
votes
1 answer
Module build failed: Error: "extract-text-webpack-plugin" when import .scss file
this issue occurred when I import .scss file in react component.
package.json
"scripts": {
"dev": "source ./.env && nodemon server.js"
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.4",
"babel-preset-env": "^1.6.1",
…

Giambi Huang
- 111
- 1
- 13
0
votes
1 answer
SCSS styles incorrectly loaded using webpack and angular 5
I'm trying to load my scss styles during AOT compilation with Angular 5.
Without AOT all works as expected but with AOT my css file looks almost the same as scss file.
scss file:
@import "bootstrap/bootstrap";
@import "rtl";
@import…
0
votes
1 answer
node-sass\vendor\win32-x64-59\binding.node is not a valid Win32 application
I am getting this weird node-sass error when my webpack is building an app. It does not happen in the console it happens in the compiled file.
https://paste.laravel.io/b9d2883d-8c12-4309-aafb-d151bc5edea6
In my entry point, there is only one line…

Andrius Solopovas
- 967
- 11
- 41
0
votes
1 answer
webpack ExtractTextPlugin unexpected '@'
So I have an angular app which uses webpack. I haven't changed anything since December where it worked fine. But upon pulling the repo on a new machine and making sure I've run npm install followed by the webpack command I'm getting the following…

Simon Willan
- 378
- 3
- 14
0
votes
1 answer
Defining path to scss files
Using sass-loader I was able to compile scss as expected by adding another entry point like the below.
entry: ['./src/assets/scripts/main.js', './src/assets/styles/_main.scss'],
However, I thought I could define a path to my source files using the…

Work-Together2013
- 1,171
- 1
- 7
- 11
0
votes
1 answer
webpack does not output css
Situation
I have a webpack setup, where I have a rule that extracts CSS and/or SASS from .ts files using the extract-text-webpack-plugin and sass-loader.
I import my SCSS file in a seperate .ts file
import './scss/style.scss'
Problem
A CSS file is…

Johansrk
- 5,160
- 3
- 38
- 37
0
votes
0 answers
No sense calc() results
I have the following sass code for a grid column:
https://codepen.io/anon/pen/zpwpOm?editors=1100
Since the grid width is 1140px (max size triggered) and $gutter-horizonta is 60px, each column width should be 540px so I would have 540px + 60px +…

Leoni
- 116
- 9
0
votes
2 answers
Parse Error in css-loader sass-loader
I am migrating from webpack 1 to 3. After going through so many errors and now I am stuck on this. Can someone please HELP!
I am getting these errors -
ERROR in ./src/main/main.scss
Module parse failed: Unexpected token (1:4)
You may need an…

Shivam Kumar
- 121
- 2
- 8
0
votes
0 answers
Webpack - Weird source map paths when using css-loader together with sass-loader
I'm using Webpack together with the css-loader, sass-loader and extract-text-webpack-plugin plugins to bundle styles for my application.
However, I'm seeing weird source map/resource paths using the plugins shown below:
The actual app.scss path is…

Jean Alexander Woldner
- 129
- 8
0
votes
0 answers
Module not found: Error: Can't resolve 'style-loader'
error
I got the following error when run node index.js command in the b directory.
ERROR in ../a/src/index.js
Module not found: Error: Can't resolve 'style-loader' in 'C:\Users\qwer\Desktop\work\test\b'
@ ../a/src/index.js 3:0-21
Child…

left click
- 894
- 10
- 21