mirror of
https://github.com/vitejs/vite.git
synced 2024-11-21 14:48:41 +00:00
fix(css): remove pure css chunk sourcemap (#14290)
This commit is contained in:
parent
34826aae01
commit
2b80089491
@ -786,6 +786,7 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin {
|
||||
pureCssChunkNames.forEach((fileName) => {
|
||||
removedPureCssFiles.set(fileName, bundle[fileName] as RenderedChunk)
|
||||
delete bundle[fileName]
|
||||
delete bundle[`${fileName}.map`]
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,8 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
import { findAssetFile, isBuild } from '~utils'
|
||||
|
||||
describe.runIf(isBuild)('css lib entry', () => {
|
||||
test('remove useless js sourcemap', async () => {
|
||||
expect(findAssetFile('linked.js.map', 'lib-entry', './')).toBe('')
|
||||
})
|
||||
})
|
1
playground/css-sourcemap/index.js
Normal file
1
playground/css-sourcemap/index.js
Normal file
@ -0,0 +1 @@
|
||||
export default 'hello'
|
13
playground/css-sourcemap/vite.config-lib-entry.js
Normal file
13
playground/css-sourcemap/vite.config-lib-entry.js
Normal file
@ -0,0 +1,13 @@
|
||||
import { defineConfig } from 'vite'
|
||||
|
||||
export default defineConfig({
|
||||
build: {
|
||||
cssCodeSplit: true,
|
||||
sourcemap: true,
|
||||
outDir: 'dist/lib-entry',
|
||||
lib: {
|
||||
entry: ['./index.js', './linked.css'],
|
||||
formats: ['es'],
|
||||
},
|
||||
},
|
||||
})
|
Loading…
Reference in New Issue
Block a user