Skip to content

Commit b9cc77d

Browse files
committed
Dokumenter Vite plugin
1 parent c2db22c commit b9cc77d

File tree

1 file changed

+27
-29
lines changed

1 file changed

+27
-29
lines changed

packages/internarbeidsflate-decorator-v3/vite.config.ts

+27-29
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,36 @@ import { resolve } from 'path';
44
import react from '@vitejs/plugin-react';
55

66

7-
export default defineConfig(() => {
8-
const htmlPath = process.env.INTERNARBEIDSFLATE_DECORATOR_HTML_PATH || 'index.html';
9-
10-
return {
11-
plugins: [
12-
react(),
13-
{
14-
name: 'html-transform',
15-
transformIndexHtml: {
16-
order: 'pre',
17-
handler() {
18-
return readFileSync(resolve(__dirname, htmlPath), 'utf-8');
19-
}
7+
export default defineConfig({
8+
plugins: [
9+
react(),
10+
// Plugin som velger hvilken html-fil som skal brukes av dev-serveren
11+
{
12+
name: 'html-transform',
13+
transformIndexHtml: {
14+
order: 'pre',
15+
handler() {
16+
const htmlPath = process.env.INTERNARBEIDSFLATE_DECORATOR_HTML_PATH || 'index.html';
17+
return readFileSync(resolve(__dirname, htmlPath), 'utf-8');
2018
}
2119
}
22-
],
23-
build: {
24-
cssMinify: true,
25-
minify: true,
26-
manifest: 'asset-manifest.json',
27-
rollupOptions: {
28-
input: 'src/index.ts',
29-
preserveEntrySignatures: 'exports-only',
30-
// external: ["react", "react-dom"],
31-
output: {
32-
entryFileNames: 'bundle.js',
33-
// format: "iife",
34-
inlineDynamicImports: true,
35-
assetFileNames: '[name].[ext]'
36-
}
20+
}
21+
],
22+
build: {
23+
cssMinify: true,
24+
minify: true,
25+
manifest: 'asset-manifest.json',
26+
rollupOptions: {
27+
input: 'src/index.ts',
28+
preserveEntrySignatures: 'exports-only',
29+
// external: ["react", "react-dom"],
30+
output: {
31+
entryFileNames: 'bundle.js',
32+
// format: "iife",
33+
inlineDynamicImports: true,
34+
assetFileNames: '[name].[ext]'
3735
}
3836
}
39-
};
37+
}
4038
}
4139
);

0 commit comments

Comments
 (0)