From b4abe3f1a1c46c720b43995fbcff3bdeed75b973 Mon Sep 17 00:00:00 2001 From: Angus Hollands Date: Fri, 31 May 2024 16:36:23 +0100 Subject: [PATCH] upgrade vite --- package.json | 2 +- themes/book/postcss.config.mjs | 5 +++ themes/book/tsconfig.json | 9 +++-- themes/book/vite.config.dev.ts | 13 +++--- themes/book/vite.config.ts | 72 ---------------------------------- 5 files changed, 18 insertions(+), 83 deletions(-) create mode 100644 themes/book/postcss.config.mjs delete mode 100644 themes/book/vite.config.ts diff --git a/package.json b/package.json index 34245991e..ec37a02bb 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "tailwindcss": "^3.3.2", "turbo": "latest", "typescript": "^5.1.3", - "vitest": "^0.32.0" + "vitest": "^1.6.0" }, "engines": { "npm": ">=7.0.0", diff --git a/themes/book/postcss.config.mjs b/themes/book/postcss.config.mjs new file mode 100644 index 000000000..01bf7432f --- /dev/null +++ b/themes/book/postcss.config.mjs @@ -0,0 +1,5 @@ +export default { + plugins: { + tailwindcss: {}, + }, +}; diff --git a/themes/book/tsconfig.json b/themes/book/tsconfig.json index 282eb6787..76a9ef40a 100644 --- a/themes/book/tsconfig.json +++ b/themes/book/tsconfig.json @@ -1,14 +1,15 @@ { "include": ["remix.env.d.ts", "**/*.ts", "**/*.tsx"], "compilerOptions": { - "lib": ["DOM", "DOM.Iterable", "ES2019"], - "types": ["@remix-run/node", "vite/client"], + "lib": ["DOM", "DOM.Iterable", "ES2022"], "isolatedModules": true, "esModuleInterop": true, + "types": ["@remix-run/node", "vite/client"], "jsx": "react-jsx", - "moduleResolution": "node", + "moduleResolution": "Bundler", + "module": "ESNext", "resolveJsonModule": true, - "target": "ES2019", + "target": "ES2022", "strict": true, "allowJs": true, "forceConsistentCasingInFileNames": true, diff --git a/themes/book/vite.config.dev.ts b/themes/book/vite.config.dev.ts index 54254cd66..eb402a4b5 100644 --- a/themes/book/vite.config.dev.ts +++ b/themes/book/vite.config.dev.ts @@ -1,16 +1,17 @@ import { vitePlugin as remix } from '@remix-run/dev'; import { defineConfig } from 'vite'; -import tsconfigPaths from "vite-tsconfig-paths"; - - +import tsconfigPaths from 'vite-tsconfig-paths'; export default defineConfig({ plugins: [ remix({ + ssr: false, basename: '/', - ignoredRouteFiles: ['**/*'], + ignoredRouteFiles: ['**/*.css'], serverBuildFile: 'api/index.js', + + }), + tsconfigPaths(), }), - tsconfigPaths() ], publicDir: '/myst_assets_folder/', resolve: { @@ -58,7 +59,7 @@ export default defineConfig({ 'tex-to-typst', 'jats-tags', /^@myst-theme\/.*/, - 'react-syntax-highlighter', + /react-syntax-highlighter.*/, 'markdown-it-myst-extras', 'markdown-it-dollarmath', 'markdown-it-amsmath', diff --git a/themes/book/vite.config.ts b/themes/book/vite.config.ts deleted file mode 100644 index 54254cd66..000000000 --- a/themes/book/vite.config.ts +++ /dev/null @@ -1,72 +0,0 @@ -import { vitePlugin as remix } from '@remix-run/dev'; -import { defineConfig } from 'vite'; -import tsconfigPaths from "vite-tsconfig-paths"; - - -export default defineConfig({ - plugins: [ - remix({ - basename: '/', - ignoredRouteFiles: ['**/*'], - serverBuildFile: 'api/index.js', - }), - tsconfigPaths() - ], - publicDir: '/myst_assets_folder/', - resolve: { - mainFields: ['main', 'module'], - }, - build: { - minify: false, - }, - ssr: { - noExternal: [ - /^rehype.*/, - /^remark.*/, - /^unified.*/, - /^unist.*/, - /^hast.*/, - /^mdast.*/, - /^micromark.*/, - /^csv-parse.*/, - 'html-whitespace-sensitive-tag-names', - 'html-void-elements', - 'property-information', - 'array-iterate', - 'stringify-entities', - 'comma-separated-tokens', - 'trim-trailing-lines', - 'escape-string-regexp', - 'ccount', - 'web-namespaces', - 'space-separated-tokens', - 'character-entities-legacy', - 'character-entities-html4', - 'trim-lines', - 'bail', - 'is-plain-obj', - 'trough', - 'zwitch', - 'nanoid', - /^vfile.*/, - /^myst-.*/, - 'markdown-it-myst', - 'simple-validators', - 'doi-utils', - 'orcid', - 'credit-roles', - 'tex-to-typst', - 'jats-tags', - /^@myst-theme\/.*/, - 'react-syntax-highlighter', - 'markdown-it-myst-extras', - 'markdown-it-dollarmath', - 'markdown-it-amsmath', - 'swr', - 'swr/immutable', - 'devlop', - '@curvenote/ansi-to-react', - 'jats-utils', - ], - }, -});