-
-
Notifications
You must be signed in to change notification settings - Fork 4.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
PostCSS Loader - SourceMap warning #1095
Comments
This is my solution, I hope this will help you. nuxt.config.js build: {
postcss: [],
extend (config) {
const postcssLoader = {
loader: 'postcss-loader?sourceMap'
}
config.module.rules.forEach(loader => {
if (loader.test.toString() === '/\\.styl(us)?$/') {
loader.use.splice(-1, 0, postcssLoader)
}
if (loader.loader === 'vue-loader') {
loader.query.loaders.stylus.splice(-1, 0, postcssLoader)
loader.query.loaders.styl.splice(-1, 0, postcssLoader)
}
})
}
} postcss.config.js module.exports = {
plugins: [
require('postcss-cssnext')({
warnForDuplicates: false,
browsers: [
'Chrome >= 28',
'Firefox >= 28',
'Edge >= 12',
'Explorer >= 9',
'Safari >= 5.1',
'iOS >= 7',
'Android >= 4',
'ExplorerMobile >= 11',
'ChromeAndroid >= 54',
'FirefoxAndroid >= 50',
'UCAndroid >= 11',
'OperaMobile >= 12.1',
'BlackBerry >= 10',
'Samsung >= 4'
]
}),
require('postcss-import')(),
require('cssnano')({
preset: 'default'
})
]
} |
hi @maicong. Sadly still getting the same error related to the sourceMap isn't set. |
How would I disable sourceMap option on vue-style-loader and css-loader? |
@frankspin89 |
The problems with postcss and its source map are going to almost resolved in next ( |
Now is available :) |
Sorry @pi0 for resurrecting this issue but I still see same error on my console. It throws |
Okay, I here is what's wrong: Don't include <style lang="postcss" scoped>
...
</style> to <style scoped>
...
</style> |
I have got the same problem and @cihadturhan solution works. However, now the syntax highlighting in VS Code (Vetur plugin) is wrong, because not including the |
In my case, I was able to get rid of them by putting postcss-loader after stylus-loader. Is there a reason for that? Does it cause other issues? |
Hi @chanlito, this is a closed isssue, could you please open a new one and follow the issue template ? |
@chanlito |
Having the same minor issue as #1095 (comment) . @clarkdo is this something i should log under the Vetur (@octref) project? Or is there something i can do to correctly get VS Code to highlight styles correctly as PostCSS and have it compile correctly with nuxt-edge? |
You can see the discussion here: vuejs/vetur#506 vuejs/vue-cli#1259 Vetur / VS Code uses textmate grammar which is not as flexible as build tools. It doesn't know your build config and don't know if you are using postcss. Another issue is that we have CSS error-checking, but not PostCSS error-checking, as currently there is no PostCSS error checker available, so I have to turn off error-checking for PostCSS sections. So, if you have a flexible build tool, you should make I like things being explicit and simple:
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
PostCSS loader keeps complaining about soureMap isn't set. Tried many different things, but nothing seems to work.
nuxt.config.js
postcss.config.js
The text was updated successfully, but these errors were encountered: