|
2
|
1 import { defineConfig } from "vite";
|
|
|
2 import laravel from "laravel-vite-plugin";
|
|
|
3 import prism from 'vite-plugin-prismjs';
|
|
|
4 import fs from "fs";
|
|
|
5 import path from "path";
|
|
|
6
|
|
|
7 const pagesDir = "resources/js/pages";
|
|
|
8 const pageScripts = fs
|
|
|
9 .readdirSync(pagesDir)
|
|
|
10 .map((file) => path.join(pagesDir, file));
|
|
|
11
|
|
|
12 export default defineConfig({
|
|
3
|
13 // Optional: Silence Sass deprecation warnings. See note below.
|
|
|
14 css: {
|
|
|
15 preprocessorOptions: {
|
|
|
16 scss: {
|
|
|
17 silenceDeprecations: [
|
|
|
18 'import',
|
|
|
19 'mixed-decls',
|
|
|
20 'color-functions',
|
|
|
21 'global-builtin',
|
|
|
22 ],
|
|
|
23 },
|
|
|
24 },
|
|
|
25 },
|
|
2
|
26 plugins: [
|
|
|
27 laravel({
|
|
|
28 input: [
|
|
|
29 "resources/css/app.css",
|
|
|
30 "resources/js/app.js",
|
|
|
31 "resources/js/easymde.js",
|
|
3
|
32 "resources/js/prismjs.js",
|
|
2
|
33 ...pageScripts,
|
|
|
34 ],
|
|
|
35 refresh: true,
|
|
|
36 }),
|
|
|
37 prism({
|
|
|
38 languages: ["javascript", "css", "html", "typescript", "php", "sql", "bash", "sh"],
|
|
|
39 plugins: ["line-numbers"],
|
|
|
40 theme: "tomorrow",
|
|
|
41 css: true,
|
|
|
42 }),
|
|
|
43 ],
|
|
|
44 });
|