forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Improve Sass Error * test sass error massage * use quotes Co-authored-by: JJ Kasper <[email protected]>
- Loading branch information
Showing
7 changed files
with
92 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Install `sass` to Use Built-In Sass Support | ||
|
||
#### Why This Error Occurred | ||
|
||
Using Next.js' [built-in Sass support](https://nextjs.org/docs/basic-features/built-in-css-support#sass-support) requires that you bring your own version of Sass. | ||
|
||
#### Possible Ways to Fix It | ||
|
||
Please install the `sass` package in your project. | ||
|
||
```bash | ||
npm i sass | ||
# or | ||
yarn add sass | ||
``` | ||
|
||
### Useful Links | ||
|
||
- [Sass Support in Documentation](https://nextjs.org/docs/basic-features/built-in-css-support#sass-support) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
let originalLoader | ||
const M = require('module') | ||
originalLoader = M._load | ||
M._load = function hookedLoader(request, parent, isMain) { | ||
if (request === 'node-sass') request = 'node-sass-begone' | ||
return originalLoader(request, parent, isMain) | ||
} |
12 changes: 12 additions & 0 deletions
12
test/integration/scss-fixtures/webpack-error/pages/_app.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from 'react' | ||
import App from 'next/app' | ||
import '../styles/global.scss' | ||
|
||
class MyApp extends App { | ||
render() { | ||
const { Component, pageProps } = this.props | ||
return <Component {...pageProps} /> | ||
} | ||
} | ||
|
||
export default MyApp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function Home() { | ||
return <div className="red-text">This text should be red.</div> | ||
} |
4 changes: 4 additions & 0 deletions
4
test/integration/scss-fixtures/webpack-error/styles/global.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
$var: red; | ||
.red-text { | ||
color: $var; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters