Skip to content

Commit 37fe248

Browse files
author
arnoson
committed
feat: treat css as entry
BREAKING CHANGE: until now, a CSS file was always coupled to a JS entry: `vite()->css('index.js')` and the JS entry would have to import the CSS file. With this change, the CSS file is an entry itself and can be loaded by its name: `vite()->css('index.css')`. Note: for this to work the CSS file has to be added to `rollupOptions.input` in the `vite.config.js`.
1 parent 6551cc7 commit 37fe248

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Vite.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public function js($entry = null, $options = []): ?string {
142142
public function css($entry = null, array $options = null): ?string {
143143
return !$this->isDev()
144144
? css(
145-
$this->assetProd($this->manifestProperty($entry, 'css')[0]),
145+
$this->assetProd($this->manifestProperty($entry, 'file')),
146146
$options
147147
)
148148
: null;

0 commit comments

Comments
 (0)