Skip to content

Commit

Permalink
Dokumenter Vite plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
oddgfa committed May 3, 2024
1 parent c2db22c commit b9cc77d
Showing 1 changed file with 27 additions and 29 deletions.
56 changes: 27 additions & 29 deletions packages/internarbeidsflate-decorator-v3/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,36 @@ import { resolve } from 'path';
import react from '@vitejs/plugin-react';


export default defineConfig(() => {
const htmlPath = process.env.INTERNARBEIDSFLATE_DECORATOR_HTML_PATH || 'index.html';

return {
plugins: [
react(),
{
name: 'html-transform',
transformIndexHtml: {
order: 'pre',
handler() {
return readFileSync(resolve(__dirname, htmlPath), 'utf-8');
}
export default defineConfig({
plugins: [
react(),
// Plugin som velger hvilken html-fil som skal brukes av dev-serveren
{
name: 'html-transform',
transformIndexHtml: {
order: 'pre',
handler() {
const htmlPath = process.env.INTERNARBEIDSFLATE_DECORATOR_HTML_PATH || 'index.html';
return readFileSync(resolve(__dirname, htmlPath), 'utf-8');
}
}
],
build: {
cssMinify: true,
minify: true,
manifest: 'asset-manifest.json',
rollupOptions: {
input: 'src/index.ts',
preserveEntrySignatures: 'exports-only',
// external: ["react", "react-dom"],
output: {
entryFileNames: 'bundle.js',
// format: "iife",
inlineDynamicImports: true,
assetFileNames: '[name].[ext]'
}
}
],
build: {
cssMinify: true,
minify: true,
manifest: 'asset-manifest.json',
rollupOptions: {
input: 'src/index.ts',
preserveEntrySignatures: 'exports-only',
// external: ["react", "react-dom"],
output: {
entryFileNames: 'bundle.js',
// format: "iife",
inlineDynamicImports: true,
assetFileNames: '[name].[ext]'
}
}
};
}
}
);

0 comments on commit b9cc77d

Please sign in to comment.