-
Notifications
You must be signed in to change notification settings - Fork 27.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add custom alias for scss import in 'with-global-stylesheet' example #1325
Comments
There is some discussion going on about this in here davibe/next.js-example-with-global-stylesheet#3 |
@davibe lets keep the discussion there then. When it's done I'd love a PR back 👍 |
@aulneau I plan to work on a PR / upgrade of |
@orlin @timneutkens @davibe great, thank you all. For anyone who happens upon this issue, I have it working as such:
and I can now import in my scss files as such: |
@aulneau you’re welcome. Btw, the following part of your {
test: /\.scss$/,
loader: 'babel-loader!raw-loader!sass-loader'
},
{
test: /\.scss$/,
loader: 'sass-loader',
options: {
includePaths: ['common/scss']
.map((d) => path.join(__dirname, d))
.map((g) => glob.sync(g))
.reduce((a, c) => a.concat(c), [])
}
} … can be reduced to: { test: /\.scss$/,
use: [
'babel-loader', 'raw-loader',
{ loader: 'sass-loader',
options: {
includePaths: ['common/scss']
.map((d) => path.join(__dirname, d))
}
}
]
}, You aren’t using |
Hello!
First off, I love what ya'll are making :)
I am trying to add an alias so that I can import some common scss files into places that need it without having to reference the files relatively.
~scss/filename
vs../../../../common/scss/filename
I have used this in other webpack projects:
But I am not sure how to implement it in my
next.config.js
And this is my
next.config.js
The text was updated successfully, but these errors were encountered: