Added vite

This commit is contained in:
Simon-Martens
2024-01-25 14:18:01 +01:00
parent 3921f907fb
commit e033bd23f3
8 changed files with 1072 additions and 36 deletions

24
HaWeb/.gitignore vendored Normal file
View File

@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

View File

@@ -18,7 +18,7 @@
<link rel="preload" href="/fonts/LinLibertine_RBah.ttf" as="font" crossorigin/> <link rel="preload" href="/fonts/LinLibertine_RBah.ttf" as="font" crossorigin/>
@* Styles *@ @* Styles *@
<link rel="stylesheet" href="/css/output.css" asp-append-version="true" /> <link rel="stylesheet" href="/dist/style.css" asp-append-version="true" />
@* JavaScript *@ @* JavaScript *@
@await Html.PartialAsync("/Views/Shared/_JavaScript.cshtml") @await Html.PartialAsync("/Views/Shared/_JavaScript.cshtml")

1050
HaWeb/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,24 +1,20 @@
{ {
"name": "haweb", "name": "haweb",
"version": "1.0.0", "private": true,
"description": "", "version": "0.0.0",
"main": "index.js", "type": "module",
"scripts": { "scripts": {
"css_build": "npx postcss wwwroot/css/site.css -o wwwroot/css/output.css", "dev": "vite",
"watch": "npx postcss wwwroot/css/site.css -o wwwroot/css/output.css -w --verbose" "build": "vite build",
"preview": "vite preview"
}, },
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": { "devDependencies": {
"vite": "^5.0.8",
"autoprefixer": "^10.4.7", "autoprefixer": "^10.4.7",
"cssnano": "^5.1.11", "cssnano": "^5.1.11",
"postcss": "^8.4.14", "postcss": "^8.4.14",
"postcss-cli": "^9.1.0", "postcss-cli": "^9.1.0",
"postcss-import": "^14.1.0", "postcss-import": "^14.1.0",
"tailwindcss": "^3.0.24" "tailwindcss": "^3.0.24"
},
"watch": {
"css_build": "wwwroot/css/site.css"
} }
} }

13
HaWeb/vite.config.js Normal file
View File

@@ -0,0 +1,13 @@
import { resolve } from 'path';
import { defineConfig } from 'vite';
export default defineConfig({
build: {
lib: {
entry: resolve(__dirname, 'wwwroot/js/main.js'),
name: 'HaWeb',
fileName: 'scripts'
},
outDir: resolve(__dirname, 'wwwroot/dist/'),
}
});

1
HaWeb/wwwroot/js/main.js Normal file
View File

@@ -0,0 +1 @@
import "../css/site.css";