Replies: 5 comments 6 replies
-
I can't seem to get this to generate any css source maps at all. build: {
//...
sourcemap: true,
css: {
devSourcemap: true,
preprocessorOptions: {
less: {
sourceMap: true,
},
},
}, with less installed. |
Beta Was this translation helpful? Give feedback.
-
Leaving here a comment that we should wait to stabilize this option. We're working on a new API surface that includes a new Instead of |
Beta Was this translation helpful? Give feedback.
-
@patak-dev The PR you mentioned is merged, but I can't find a
@usizu: same here, I tried to set
.. without any luck .. a Not sure its related, but I'm using LESS files .. here is my config / what I have tried without luck. css: {
devSourcemap: true,
preprocessorOptions: {
less: {
sourceMap: {
outputSourceFiles: true,
sourceMapURL: (name) => { const s = name.split('/'); return s[s.length - 1] + '.map'; },
},
},
},
},
build: {
manifest: "manifest.json",
emptyOutDir: true,
sourcemap: true,
rollupOptions: {
input: {
"css/style.css": PATH.src + "/less/style.less",
},
output: {
entryFileNames: "[name].js",
chunkFileNames: "[name].js",
assetFileNames: "[name].[ext]",
// Vite does not support "rollupOptions.output.sourcemap". Please use "build.sourcemap" instead.
// sourcemap: true,
},
},
}, |
Beta Was this translation helpful? Give feedback.
-
This used to work with me as css.devSourcemap but at some point in the past some months stopped working. I'm currently using vite 5.4.12 Is I see that vite 6 is out; I could upgrade if that would give me a way to working sass sourcemaps. the Sass sourcemaps in dev are important to me, and it was great when they used to work, it was part of why I chose vite, I'd love to get them back! |
Beta Was this translation helpful? Give feedback.
-
I forget where I found this but I've had it working for a while now, here is the relevant part of my viteconfig. I'm using SASS not LESS anymore btw. Also have import { defineConfig } from "vite";
export default defineConfig(({ mode }) => {
return {
css: {
devSourcemap: true,
},
build: { ... },
preview: {...}
}
}
}
If I comment out the I was playing around with it just now and I can comment out all the plugins etc, rollup etc, and the only thing that makes a difference is that one line |
Beta Was this translation helpful? Give feedback.
-
css.devSourcemap
Starting a discussion to gather feedback about this feature, so we can move it out of experimental in a future version of Vite. We should also discuss its default value too.
Beta Was this translation helpful? Give feedback.
All reactions