diff --git a/packages/docusaurus-search-local/babel.config.js b/packages/docusaurus-search-local/babel.config.js index 5985f8f..ebc303f 100644 --- a/packages/docusaurus-search-local/babel.config.js +++ b/packages/docusaurus-search-local/babel.config.js @@ -1,11 +1,7 @@ -const assert = require("assert"); - module.exports = (api) => { - const isTest = api.env("test"); - assert(isTest, "babel.config.js is only used for testing with jest!"); + api.cache.never(); return { - // Jest presets: [ ["@babel/preset-env", { targets: { node: "current" } }], "@babel/preset-typescript", diff --git a/packages/docusaurus-search-local/package.json b/packages/docusaurus-search-local/package.json index 52f5431..c1e6cf0 100644 --- a/packages/docusaurus-search-local/package.json +++ b/packages/docusaurus-search-local/package.json @@ -49,6 +49,7 @@ "@babel/core": "^7.21.0", "@babel/preset-env": "^7.20.2", "@babel/preset-typescript": "^7.21.0", + "@docusaurus/core": "catalog:", "@docusaurus/module-type-aliases": "catalog:", "@docusaurus/plugin-content-blog": "catalog:", "@docusaurus/plugin-content-docs": "catalog:", @@ -75,8 +76,8 @@ "typescript": "^5.0.0" }, "scripts": { - "build:client": "tsc --project tsconfig.client.json && copyfiles --up 1 src/client/**/*.css lib", - "build:server": "tsc --project tsconfig.server.json && copyfiles --up 1 src/lunr.js src/server/lunr-generator.js lib", + "build:client": "tsc --project tsconfig.client.json && copyfiles --up 1 src/lunr.js src/client/**/*.css lib", + "build:server": "tsc --project tsconfig.server.json && babel src/server --out-dir lib/server --extensions .ts,.js,.tsx,.jsx,.cjs,.mjs && copyfiles --up 1 src/lunr.js src/server/lunr-generator.js lib", "dev": "concurrently --names client,server --prefix-colors blue,green pnpm:dev:client pnpm:dev:server", "dev:client": "concurrently --names tsc,cp pnpm:dev:client:tsc pnpm:dev:client:cp", "dev:client:tsc": "tsc --project tsconfig.client.json --watch", diff --git a/packages/docusaurus-search-local/tsconfig.json b/packages/docusaurus-search-local/tsconfig.json index 39d94ff..0376553 100644 --- a/packages/docusaurus-search-local/tsconfig.json +++ b/packages/docusaurus-search-local/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "target": "ESNext", - "module":"ESNext", + "module": "ESNext", "lib": ["ESNext", "DOM"], // Declarations break Docusaurus' 'write-translations' command (#163, #129, #145) diff --git a/packages/docusaurus-search-local/tsconfig.server.json b/packages/docusaurus-search-local/tsconfig.server.json index dacc01a..c0a5585 100644 --- a/packages/docusaurus-search-local/tsconfig.server.json +++ b/packages/docusaurus-search-local/tsconfig.server.json @@ -2,7 +2,10 @@ "extends": "./tsconfig.json", "compilerOptions": { "target": "ESNext", - "lib": ["ESNext", "DOM"] + "lib": ["ESNext", "DOM"], + "module": "Preserve", + "moduleResolution": "Bundler", + "noEmit": true }, "include": ["src/server/**/*"] }