10000 feat: bare config by runyasak · Pull Request #637 · vuejs/create-vue · GitHub
[go: up one dir, main page]

Skip to content

feat: bare config #637

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: add bare-base template
  • Loading branch information
runyasak committed Dec 12, 2024
commit 39ed6b66e1c72cf4cb1ad9b94193a3f361e829a0
6 changes: 5 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,11 @@ async function init() {
renderTemplate(templateDir, root, callbacks)
}
// Render base template
render('base')
if (bare) {
render('bare-base')
} else {
render('base')
}

// Add configs.
if (needsJsx) {
Expand Down
3 changes: 3 additions & 0 deletions template/bare-base/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["Vue.volar"]
}
8 changes: 8 additions & 0 deletions template/bare-base/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"explorer.fileNesting.enabled": true,
"explorer.fileNesting.patterns": {
"tsconfig.json": "tsconfig.*.json, env.d.ts",
"vite.config.*": "jsconfig*, vitest.config.*, cypress.config.*, playwright.config.*",
"package.json": "package-lock.json, pnpm*, .yarnrc*, yarn*, .eslint*, eslint*, .prettier*, prettier*, .editorconfig"
}
}
30 changes: 30 additions & 0 deletions template/bare-base/_gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
.DS_Store
dist
dist-ssr
coverage
*.local

/cypress/videos/
/cypress/screenshots/

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

*.tsbuildinfo
13 changes: 13 additions & 0 deletions template/bare-base/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
<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.js"></script>
</body>
</html>
8 changes: 8 additions & 0 deletions template/bare-base/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"paths": {
"@/*": ["./src/*"]
}
},
"exclude": ["node_modules", "dist"]
}
17 changes: 17 additions & 0 deletions template/bare-base/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"vue": "^3.5.13"
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.2.1",
"vite": "^6.0.3",
"vite-plugin-vue-devtools": "^7.6.7"
}
}
Binary file added template/bare-base/public/favicon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions template/bare-base/src/assets/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
17 changes: 17 additions & 0 deletions template/bare-base/vite.config.js.data.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export default function getData() {
return {
plugins: [
{
id: 'vue',
importer: "import vue from '@vitejs/plugin-vue'",
initializer: 'vue()',
},

{
id: 'vite-plugin-vue-devtools',
importer: "import vueDevTools from 'vite-plugin-vue-devtools'",
initializer: 'vueDevTools()',
}
],
}
}
20 changes: 20 additions & 0 deletions template/bare-base/vite.config.js.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { fileURLToPath, URL } from 'node:url'

import { defineConfig } from 'vite'
<%_ for (const { importer } of plugins) { _%>
<%- importer %>
<%_ } _%>

// https://vite.dev/config/
export default defineConfig({
plugins: [
<%_ for (const { initializer } of plugins) { _%>
<%- initializer _%>,
<%_ } _%>
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
},
},
})
Loading
0