Commit 630c342d authored by Aral Balkan's avatar Aral Balkan
Browse files

Add Vite SRI plugin

parent a9da2a38
......@@ -14,6 +14,7 @@
"license": "ISC",
"dependencies": {
"@rollup/plugin-html": "^0.2.3",
"@small-tech/vite-plugin-sri": "^1.0.1",
"@snowpack/plugin-svelte": "^3.5.2",
"blakejs": "^1.1.0",
"buffer": "^6.0.3",
......
......@@ -4,8 +4,7 @@ import path from 'path'
import { defineConfig } from 'vite'
import svelte from '@sveltejs/vite-plugin-svelte'
import sri from 'rollup-plugin-sri'
import html from '@rollup/plugin-html'
import sri from '@small-tech/vite-plugin-sri'
const certDirectory = path.join(os.homedir(), '.small-tech.org', 'auto-encrypt-localhost')
const cert = fs.readFileSync(path.join(certDirectory, 'localhost.pem'))
......@@ -13,15 +12,12 @@ const key = fs.readFileSync(path.join(certDirectory, 'localhost-key.pem'))
// https://vitejs.dev/config/
export default defineConfig({
plugins: [svelte()],
plugins: [svelte(), sri()],
server: {
port: 444,
https: {key, cert}
},
build: {
outDir: 'dist',
rollupOptions: {
plugins: [html(), sri()]
}
}
})
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment