Set up a vite pipeline

This commit is contained in:
Jake Howard 2023-04-20 21:32:29 +01:00
parent 0f622a6c78
commit 80fe8ba99f
Signed by: jake
GPG key ID: 57AFB45680EDD477
6 changed files with 1438 additions and 52 deletions

2
.gitignore vendored
View file

@ -99,7 +99,7 @@ dist
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
public
# vuepress build output
.vuepress/dist

15
docs/index.html Normal file
View file

@ -0,0 +1,15 @@
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="Content-Language" content="en" />
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width" />
<meta name="superfish" content="nofish" />
<meta name="application-name" content="linguist.css" />
<link rel="stylesheet" href="index.scss"/>
</head>
<body>
{{#data}}
{{ slug }}: {{ color }}
{{/data}}
</body>
</html>

2
docs/index.scss Normal file
View file

@ -0,0 +1,2 @@
@import "../dist/linguist";
@import "../node_modules/bulma/bulma";

1448
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -6,18 +6,23 @@
"type": "module",
"scripts": {
"build:data": "node scripts/build.js",
"build:docs": "vite build",
"lint:output": "stylelint dist/out.scss dist/out.css"
},
"author": "",
"license": "ISC",
"dependencies": {
"bulma": "^0.9.4",
"change-case": "^4.1.2",
"handlebars": "^4.7.7",
"mkdirp": "^3.0.0",
"node-fetch": "^3.3.1",
"sass": "^1.62.0",
"slugify": "^1.6.6",
"stylelint-config-standard": "^33.0.0",
"stylelint-config-standard-scss": "^8.0.0",
"vite": "^4.3.1",
"vite-plugin-handlebars": "^1.6.0",
"yaml": "^2.2.1"
}
}

18
vite.config.js Normal file
View file

@ -0,0 +1,18 @@
import { defineConfig } from "vite";
import linguist from "./dist/linguist.json";
import handlebars from 'vite-plugin-handlebars';
export default defineConfig({
plugins: [handlebars({
context: {
data: Object.values(linguist)
}
})],
root: "./docs",
base: "./",
build: {
outDir: "../public",
emptyOutDir: true,
target: "es2015"
}
});