-
-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathastro.config.mjs
101 lines (99 loc) · 2.58 KB
/
astro.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import { defineConfig } from "astro/config"
import svelte from "@astrojs/svelte"
import mdx from "@astrojs/mdx"
import gfm from "remark-gfm"
import eslint4b from "vite-plugin-eslint4b"
import replaceLink from "./docs-build/remark-replace-link.mjs"
import "./docs-build/setup-docs.mjs"
import path from "path"
import { version as monacoVersion } from "monaco-editor/package.json"
const dirname = path.dirname(new URL(import.meta.url).pathname)
// https://astro.build/config
export default defineConfig({
base: "/eslint-plugin-astro",
srcDir: "./docs-build/src",
publicDir: "./docs-build/public",
outDir: "./docs-build/dist/eslint-plugin-astro",
root: dirname,
integrations: [
svelte(),
mdx({
remarkPlugins: [
gfm,
[
replaceLink,
{
srcDir: "./docs-build/src",
base: "/eslint-plugin-astro",
},
],
],
}),
],
markdown: {
remarkPlugins: [
gfm,
[
replaceLink,
{
srcDir: "./docs-build/src",
base: "/eslint-plugin-astro",
},
],
],
},
vite: {
define: {
MONACO_EDITOR_VERSION: JSON.stringify(monacoVersion),
},
server: {
fs: { strict: false },
},
resolve: {
alias: {
"astro-eslint-parser": path.join(
dirname,
"./docs-build/shim/astro-eslint-parser.mjs",
),
"eslint-plugin-jsx-a11y": path.join(
dirname,
"./docs-build/shim/eslint-plugin-jsx-a11y.mjs",
),
// node
url: path.join(dirname, "./docs-build/shim/url.mjs"),
module: path.join(dirname, "./docs-build/shim/module.mjs"),
globby: path.join(dirname, "./docs-build/shim/globby.mjs"),
"fast-glob": path.join(dirname, "./docs-build/shim/empty.mjs"),
// override tsconfig (it had no effect...)
"@eslint-community/eslint-utils": path.join(
dirname,
"./node_modules/@eslint-community/eslint-utils",
),
"node:path": path.join(
dirname,
"./node_modules/vite-plugin-eslint4b/shim/path-shim.mjs",
),
},
},
plugins: [
eslint4b(),
{
name: "force-alias",
enforce: "pre",
config() {
return {
resolve: {
alias: {
// override tsconfig
"@eslint-community/eslint-utils": path.join(
dirname,
"./node_modules/@eslint-community/eslint-utils",
),
},
},
}
},
},
],
},
})