-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(css): reset render cache on renderStart (#14326)
- Loading branch information
Showing
5 changed files
with
58 additions
and
1 deletion.
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
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,6 @@ | ||
// import file to test css build handling | ||
import './index.css' | ||
|
||
export default async function message(sel) { | ||
document.querySelector(sel).textContent = 'success' | ||
} |
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,6 @@ | ||
// import file to test css build handling | ||
import './index.css' | ||
|
||
export default async function message(sel) { | ||
document.querySelector(sel).textContent = 'success' | ||
} |
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,39 @@ | ||
import path from 'node:path' | ||
import { defineConfig } from 'vite' | ||
|
||
const root = process.env.VITEST | ||
? path.resolve(__dirname, '../../playground-temp/lib') | ||
: __dirname | ||
|
||
export default defineConfig({ | ||
build: { | ||
lib: { | ||
// set multiple entrypoint to trigger css chunking | ||
entry: { | ||
main: path.resolve(__dirname, 'src/main-multiple-output.js'), | ||
sub: path.resolve(__dirname, 'src/sub-multiple-output.js'), | ||
}, | ||
name: 'MyLib', | ||
}, | ||
outDir: 'dist/multiple-output', | ||
rollupOptions: { | ||
// due to playground-temp, the `dir` needs to be relative to the resolvedRoot | ||
output: [ | ||
{ | ||
dir: path.resolve(root, 'dist/multiple-output/es'), | ||
format: 'es', | ||
entryFileNames: 'index.mjs', | ||
assetFileNames: 'assets/mylib.css', | ||
}, | ||
{ | ||
dir: path.resolve(root, 'dist/multiple-output/cjs'), | ||
format: 'cjs', | ||
entryFileNames: 'index.cjs', | ||
assetFileNames: 'assets/mylib.css', | ||
}, | ||
], | ||
}, | ||
cssCodeSplit: true, | ||
}, | ||
cacheDir: 'node_modules/.vite-multiple-output', | ||
}) |