fix(vite): asset handling (#3225)
This PR reworks asset handling in our vite plugin. Importing assets in js is now supported.
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 79 KiB |
@@ -0,0 +1 @@
|
||||
@import "tailwindcss";
|
||||
@@ -0,0 +1 @@
|
||||
import "./assets/style.css";
|
||||
@@ -0,0 +1,5 @@
|
||||
import logo from "../../assets/deno-logo.png";
|
||||
|
||||
export function IslandAssets() {
|
||||
return <img src={logo} alt="" />;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import logo from "../../assets/deno-logo.png";
|
||||
|
||||
export default function Page() {
|
||||
return <img src={logo} alt="" />;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import { IslandAssets } from "../../islands/tests/IslandAssets.tsx";
|
||||
|
||||
export default function Page() {
|
||||
return <IslandAssets />;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export default function Page() {
|
||||
return <h1 class="text-red-500">this should be red</h1>;
|
||||
}
|
||||
@@ -1,10 +1,12 @@
|
||||
import { defineConfig } from "vite";
|
||||
import { fresh } from "@fresh/plugin-vite";
|
||||
import inspect from "vite-plugin-inspect";
|
||||
import tailwind from "@tailwindcss/vite";
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
inspect(),
|
||||
fresh(),
|
||||
tailwind(),
|
||||
],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user