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:
@@ -0,0 +1 @@
|
||||
@import "tailwindcss";
|
||||
@@ -0,0 +1 @@
|
||||
import "./assets/style.css";
|
||||
@@ -0,0 +1,3 @@
|
||||
import { App } from "@fresh/core";
|
||||
|
||||
export const app = new App().fsRoutes();
|
||||
@@ -0,0 +1,14 @@
|
||||
import type { PageProps } from "@fresh/core";
|
||||
|
||||
export default function App(props: PageProps) {
|
||||
return (
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
</head>
|
||||
<body>
|
||||
<props.Component />
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export default function Hello() {
|
||||
return <h1 class="text-red-500">ok</h1>;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import { defineConfig } from "vite";
|
||||
import { fresh } from "@fresh/plugin-vite";
|
||||
import tailwindcss from "@tailwindcss/vite";
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [fresh(), tailwindcss()],
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
@import "tailwindcss";
|
||||
@@ -0,0 +1 @@
|
||||
import "./assets/style.css";
|
||||
@@ -0,0 +1,3 @@
|
||||
import { App } from "@fresh/core";
|
||||
|
||||
export const app = new App().fsRoutes();
|
||||
@@ -0,0 +1,3 @@
|
||||
export default function Hello() {
|
||||
return <h1 class="text-red-500">ok</h1>;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import { defineConfig } from "vite";
|
||||
import { fresh } from "@fresh/plugin-vite";
|
||||
import tailwindcss from "@tailwindcss/vite";
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [fresh(), tailwindcss()],
|
||||
});
|
||||
Reference in New Issue
Block a user