refactor example
This commit is contained in:
parent
d16cb4fbda
commit
fdd857c01c
|
@ -2,9 +2,9 @@ import * as riot from "riot";
|
|||
import {Route, Router} from "@riotjs/route";
|
||||
import app from "./components/app.riot";
|
||||
|
||||
const main = {
|
||||
const boot = {
|
||||
// start-up actions here
|
||||
init() {
|
||||
start() {
|
||||
// install plugins
|
||||
this.plugins();
|
||||
|
||||
|
@ -18,8 +18,8 @@ const main = {
|
|||
// add your own features here
|
||||
component.version = {
|
||||
riot: "9.x.x",
|
||||
vite: "5.x.x",
|
||||
app: "3.1.0"
|
||||
vite: "6.x.x",
|
||||
app: "4.0.0"
|
||||
};
|
||||
});
|
||||
},
|
||||
|
@ -35,4 +35,4 @@ const main = {
|
|||
}
|
||||
}
|
||||
|
||||
main.init();
|
||||
boot.start();
|
|
@ -13,8 +13,8 @@
|
|||
</section>
|
||||
|
||||
<script>
|
||||
import RiotWelcome from "./riot-welcome.riot";
|
||||
import RiotAbout from "./riot-about.riot";
|
||||
import RiotWelcome from "../pages/riot-welcome.riot";
|
||||
import RiotAbout from "../pages/riot-about.riot";
|
||||
|
||||
export default {
|
||||
components: {
|
|
@ -7,16 +7,16 @@
|
|||
|
||||
<h3>Single-Page-Application</h3>
|
||||
|
||||
<p><code>components</code></p>
|
||||
<p><code>components/pages</code></p>
|
||||
<p><code>state</code></p>
|
||||
<p><code>routing</code></p>
|
||||
|
||||
<p>
|
||||
These core examples are in<br/>
|
||||
<code>src/components/app.riot</code>
|
||||
<code>app/components/app.riot</code>
|
||||
<p>
|
||||
global components are registered in <br/>
|
||||
<code>src/app.js</code>
|
||||
bootstrap global configuration in <br/>
|
||||
<code>app/boot.js</code>
|
||||
</p>
|
||||
</p>
|
||||
<br>
|
|
@ -3,18 +3,19 @@
|
|||
<h2>Welcome to Your Riot.js Application</h2>
|
||||
|
||||
<p>
|
||||
Start your development with
|
||||
<a>Riot</a>, a component-based ui library, running on the
|
||||
<a>Vite</a> front-end tooling.
|
||||
Start development with
|
||||
<a>RiotJS</a>, a component-based ui library,
|
||||
<a>Riot/Route</a>, a client-side routing library, and
|
||||
<a>Vite</a> front-end build tooling.
|
||||
</p>
|
||||
|
||||
<h3>Getting Started</h3>
|
||||
<p>
|
||||
This page is found at <br/>
|
||||
<code>src/components/riot-welcome.riot</code>
|
||||
<code>app/pages/riot-welcome.riot</code>
|
||||
<p>
|
||||
and is registered via <br/>
|
||||
<code>src/app.js</code>
|
||||
<code>app/boot.js</code>
|
||||
</p>
|
||||
</p>
|
||||
|
||||
|
@ -30,7 +31,7 @@
|
|||
<span>
|
||||
<a href="https://vitejs.dev/guide/">Vite</a>
|
||||
<br/>
|
||||
<code>v5.x</code>
|
||||
<code>v6.x</code>
|
||||
</span>
|
||||
</div>
|
||||
|
Before Width: | Height: | Size: 949 B After Width: | Height: | Size: 949 B |
Before Width: | Height: | Size: 175 KiB After Width: | Height: | Size: 175 KiB |
|
@ -3,12 +3,12 @@
|
|||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link rel="stylesheet" href="/src/css/main.css">
|
||||
<link rel="stylesheet" href="/app/css/main.css">
|
||||
<title>Riot Template</title>
|
||||
</head>
|
||||
<body>
|
||||
<app></app>
|
||||
|
||||
<script type="module" src="/src/main.js"></script>
|
||||
<script type="module" src="/app/boot.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -2,8 +2,8 @@ import { defineConfig } from "vite";
|
|||
import riot from 'rollup-plugin-riot';
|
||||
|
||||
export default defineConfig({
|
||||
input: "src/components",
|
||||
input: "app/**/*",
|
||||
output: "dist/bundle.js",
|
||||
plugins: [riot()],
|
||||
publicDir: 'src/public'
|
||||
publicDir: 'app/public'
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue