how to use sass now?
See original GitHub issueI know you guys are going to support sass, but I really need to use it now. Here is the error. I add sass loader and url loader in the original webpack.dev.config
{
test: /\.scss$/,
loaders: ['style', 'css', 'resolve-url', 'sass?sourceMap']
},
{ test: /\.(png|jpg|jpeg|gif)$/,
loader: 'url-loader?limit=10000'
}
in order to use material ui. I edited in babelrc. I found this solution in one of issues.
{
"presets": ["react", "es2015", "stage-1"],
"plugins": ["transform-decorators-legacy"]
}
The problem is very confusing. It seems like the error is from babel. Each time I rerun my project I need comments my the import scss file. After successful running, remove the comments, and project runs perfectly. So I think the error caused when first time run the project. I use scss like this
import "./Auth.scss"
Error
D:\code\uhccj\uhccjDashboard\node_modules\babel-core\lib\transformation\file\index.js:556
throw err;
^
SyntaxError: D:/code/uhccj/uhccjDashboard/shared/container/Auth/Auth/Auth.scss: Unexpected token (1:0)
> 1 | .auth{
| ^
2 | min-height: 100%;
3 | background: url("./background.jpg") no-repeat center center fixed;
4 | -webkit-background-size: cover;
at Parser.pp.raise (D:\code\uhccj\uhccjDashboard\node_modules\babylon\index.js:1378:13)
at Parser.pp.unexpected (D:\code\uhccj\uhccjDashboard\node_modules\babylon\index.js:2817:8)
at Parser.pp.parseExprAtom (D:\code\uhccj\uhccjDashboard\node_modules\babylon\index.js:749:12)
at Parser.parseExprAtom (D:\code\uhccj\uhccjDashboard\node_modules\babylon\index.js:4305:22)
at Parser.pp.parseExprSubscripts (D:\code\uhccj\uhccjDashboard\node_modules\babylon\index.js:504:19)
at Parser.pp.parseMaybeUnary (D:\code\uhccj\uhccjDashboard\node_modules\babylon\index.js:484:19)
at Parser.pp.parseExprOps (D:\code\uhccj\uhccjDashboard\node_modules\babylon\index.js:415:19)
at Parser.pp.parseMaybeConditional (D:\code\uhccj\uhccjDashboard\node_modules\babylon\index.js:397:19)
at Parser.pp.parseMaybeAssign (D:\code\uhccj\uhccjDashboard\node_modules\babylon\index.js:360:19)
at Parser.pp.parseExpression (D:\code\uhccj\uhccjDashboard\node_modules\babylon\index.js:324:19)
at Parser.pp.parseStatement (D:\code\uhccj\uhccjDashboard\node_modules\babylon\index.js:1874:19)
at Parser.parseStatement (D:\code\uhccj\uhccjDashboard\node_modules\babylon\index.js:3507:22)
at Parser.pp.parseBlockBody (D:\code\uhccj\uhccjDashboard\node_modules\babylon\index.js:2208:21)
at Parser.pp.parseTopLevel (D:\code\uhccj\uhccjDashboard\node_modules\babylon\index.js:1747:8)
at Parser.parse (D:\code\uhccj\uhccjDashboard\node_modules\babylon\index.js:1349:17)
at Object.parse (D:\code\uhccj\uhccjDashboard\node_modules\babylon\index.js:45:50)
[nodemon] app crashed - waiting for file changes before starting...
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
How to Use Sass with CSS - freeCodeCamp
First, download and install Microsoft's VS Code editor if you haven't already. Then launch the editor so you can download the Live Sass...
Read more >Sass Basics
Once Sass is installed, you can compile your Sass to CSS using the sass command. You'll need to tell Sass which file to...
Read more >The definitive guide to SCSS - LogRocket Blog
The structure of SCSS follows that of CSS. First, choose one or more elements using IDs, classes, or other CSS selectors. Then, add...
Read more >How to use Sass - Quackit Tutorials
Here's how to create your first Sass file and convert it to CSS automatically. Now that we have Sass installed, let's go right...
Read more >SASS Installation - SASS Variables - Tech Altum Tutorial
There are two ways to use sass, application or Command Line. I'll prefer using command line as there is minimum installation. To install...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
my advice is to ditch sass for post-css, it has a pre-css plugin that supports sass syntax It’s all in JS and it runs smoothly You could spot a momentum in the community with many plugins in the post-css eco-system My 2 cents
ok,got it.