forked from hannoeru/vite-plugin-pages
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: refactor version of vite-plugin-voie
- Loading branch information
0 parents
commit 9b26f71
Showing
30 changed files
with
4,734 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"extends": "@antfu/eslint-config", | ||
"rules": { | ||
"@typescript-eslint/no-unused-vars": "off" | ||
} | ||
} |
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,3 @@ | ||
node_modules | ||
.DS_Store | ||
dist |
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 @@ | ||
# vite-plugin-pages |
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,12 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Vite App</title> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script type="module" src="/src/main.ts"></script> | ||
</body> | ||
</html> |
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,19 @@ | ||
{ | ||
"private": true, | ||
"scripts": { | ||
"dev": "cross-env DEBUG=vite-plugin-pages vite", | ||
"build": "cross-env DEBUG=vite-plugin-pages vite build" | ||
}, | ||
"dependencies": { | ||
"vue": "^3.0.5", | ||
"vue-router": "4.0.3" | ||
}, | ||
"devDependencies": { | ||
"@vitejs/plugin-vue": "^1.0.5", | ||
"@vue/compiler-sfc": "^3.0.5", | ||
"cross-env": "^7.0.3", | ||
"typescript": "^4.1.3", | ||
"vite": "^2.0.0-beta.21", | ||
"vite-plugin-pages": "workspace:*" | ||
} | ||
} |
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,4 @@ | ||
|
||
<template> | ||
<router-view /> | ||
</template> |
Empty file.
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,19 @@ | ||
import { createApp } from 'vue' | ||
import { createRouter, createWebHistory } from 'vue-router' | ||
import routes from 'vite-plugin-pages/client' | ||
|
||
import App from './App.vue' | ||
import './index.css' | ||
|
||
const router = createRouter({ | ||
history: createWebHistory(), | ||
routes, | ||
}) | ||
|
||
const app = createApp(App) | ||
|
||
app.use(router) | ||
|
||
app.mount('#app') | ||
|
||
console.log(router) |
Empty file.
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,13 @@ | ||
<template> | ||
<p>/[id].vue</p> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
} | ||
</script> | ||
|
||
<style> | ||
</style> |
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,13 @@ | ||
<template> | ||
<p>/[sensor]/current.vue</p> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
} | ||
</script> | ||
|
||
<style> | ||
</style> |
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,13 @@ | ||
<template> | ||
<p>/about/index.vue</p> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
} | ||
</script> | ||
|
||
<style> | ||
</style> |
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,18 @@ | ||
<template> | ||
<div> | ||
<p>index.vue hahaha</p> | ||
<router-link to="/about"> | ||
aboutss | ||
</router-link> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
} | ||
</script> | ||
|
||
<style> | ||
</style> |
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,13 @@ | ||
<template> | ||
<router-view /> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
} | ||
</script> | ||
|
||
<style> | ||
</style> |
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,13 @@ | ||
<template> | ||
<p>/news/today.vue</p> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
} | ||
</script> | ||
|
||
<style> | ||
</style> |
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,13 @@ | ||
<template> | ||
<p>/news/index.vue</p> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
} | ||
</script> | ||
|
||
<style> | ||
</style> |
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,13 @@ | ||
<template> | ||
<p>1</p> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
} | ||
</script> | ||
|
||
<style> | ||
</style> |
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 { defineComponent } from 'vue' | ||
|
||
declare module '*.vue' { | ||
const Component: ReturnType<typeof defineComponent> | ||
export default Component | ||
} |
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,16 @@ | ||
import { UserConfig } from 'vite' | ||
import Vue from '@vitejs/plugin-vue' | ||
import Route from 'vite-plugin-pages' | ||
|
||
const config: UserConfig = { | ||
plugins: [ | ||
Vue(), | ||
Route({ | ||
importMode(path: string) { | ||
return path === '/src/pages/index.vue' ? 'sync' : 'async' | ||
}, | ||
}), | ||
], | ||
} | ||
|
||
export default config |
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,48 @@ | ||
{ | ||
"name": "vite-plugin-pages", | ||
"description": "File system base vue-router plugin for Vite", | ||
"version": "0.0.1", | ||
"main": "dist/index.js", | ||
"module": "dist/index.mjs", | ||
"types": "dist/index.d.ts", | ||
"license": "MIT", | ||
"author": "hannoeru <me@hanlee.co>", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/hannoeru/vite-plugin-pages" | ||
}, | ||
"homepage": "https://github.com/hannoeru/vite-plugin-pages", | ||
"bugs": "https://github.com/hannoeru/vite-plugin-pages/issues", | ||
"files": [ | ||
"dist" | ||
], | ||
"scripts": { | ||
"dev": "npm run build -- --watch", | ||
"example:dev": "npm -C example run dev", | ||
"example:build": "npm -C example run build", | ||
"build": "tsup src/index.ts --dts --format cjs,esm", | ||
"prepublishOnly": "npm run build", | ||
"release": "npx bumpp --commit --tag --push && npm publish" | ||
}, | ||
"dependencies": { | ||
"chalk": "^4.1.0", | ||
"debug": "^4.3.2", | ||
"directory-tree": "^2.2.5", | ||
"fast-glob": "^3.2.4", | ||
"glob-to-regexp": "^0.4.1" | ||
}, | ||
"devDependencies": { | ||
"@antfu/eslint-config": "^0.4.3", | ||
"@types/debug": "^4.1.5", | ||
"@types/glob-to-regexp": "^0.4.0", | ||
"@types/minimatch": "^3.0.3", | ||
"@types/node": "^14.14.20", | ||
"@typescript-eslint/eslint-plugin": "^4.12.0", | ||
"eslint": "^7.17.0", | ||
"rollup": "^2.36.1", | ||
"standard-version": "^9.1.0", | ||
"tsup": "^3.11.0", | ||
"typescript": "^4.1.3", | ||
"vite": "^2.0.0-beta.21" | ||
} | ||
} |
Oops, something went wrong.