You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a generated vite.config.ts file of a JS library, generated with --bundler=vite, dts is called with deprecated/renamed parameters - skipDiagnostics & tsConfigFilePath.
Here is the generated Vite config file:
/// <reference types='vitest' />
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import dts from "vite-plugin-dts";
import * as path from "path";
import { nxViteTsPaths } from "@nx/vite/plugins/nx-tsconfig-paths.plugin";
export default defineConfig({
root: __dirname,
cacheDir: "../../../node_modules/.vite/libs/ui-kit/ui",
plugins: [
react(),
nxViteTsPaths(),
dts({
entryRoot: "src",
tsConfigFilePath: path.join(__dirname, "tsconfig.lib.json"),
skipDiagnostics: true,
}),
],
// Uncomment this if you are using workers.
// worker: {
// plugins: [ nxViteTsPaths() ],
// },
// Configuration for building your library.
// See: https://vitejs.dev/guide/build.html#library-mode
build: {
outDir: "../../../dist/libs/ui-kit/ui",
reportCompressedSize: true,
commonjsOptions: {
transformMixedEsModules: true,
},
lib: {
// Could also be a dictionary or array of multiple entry points.
entry: "src/index.ts",
name: "ui-kit-ui",
fileName: "index",
// Change this to the formats you want to support.
// Don't forget to update your package.json as well.
formats: ["es", "cjs"],
},
rollupOptions: {
// External packages that should not be bundled into your library.
external: ["react", "react-dom", "react/jsx-runtime"],
},
},
});
Expected Behavior
The generated vite.config.ts file should not include skipDiagnostics and tsConfigFilePath should be renamed to tsconfigPath (breaking changes since 3.0.0-beta.2 (2023-06-27)).
/// <reference types='vitest' />
import { defineConfig } from "vite";
import dts from "vite-plugin-dts";
import * as path from "path";
import { nxViteTsPaths } from "@nx/vite/plugins/nx-tsconfig-paths.plugin";export default defineConfig({
root: __dirname,
cacheDir: "../../node_modules/.vite/libs/test-lib",
plugins: [
nxViteTsPaths(),
dts({
entryRoot: "src",
tsConfigFilePath: path.join(__dirname, "tsconfig.lib.json"),
skipDiagnostics: true,
}),
],
// Uncomment this if you are using workers.
// worker: {
// plugins: [ nxViteTsPaths() ],
// },
// Configuration for building your library.
// See: https://vitejs.dev/guide/build.html#library-mode
build: {
outDir: "../../dist/libs/test-lib",
reportCompressedSize: true,
commonjsOptions: {
transformMixedEsModules: true,
},
lib: {
// Could also be a dictionary or array of multiple entry points.
entry: "src/index.ts",
name: "test-lib",
fileName: "index",
// Change this to the formats you want to support.
// Don't forget to update your package.json as well. formats: ["es", "cjs"], }, rollupOptions: { // External packages that should not be bundled into your library. external: [], }, },});
Package Manager Version
pnpm v8.15.4
Operating System
macOS
Linux
Windows
Other (Please specify)
Additional Information
No response
The text was updated successfully, but these errors were encountered:
zivattias
changed the title
Outdated vite.config.ts for a @nx/js:lib generated w/ --bundler=vite
Deprecated vite.config.ts for a @nx/js:lib generated w/ --bundler=vite
Mar 7, 2024
Current Behavior
In a generated
vite.config.ts
file of a JS library, generated with--bundler=vite
,dts
is called with deprecated/renamed parameters -skipDiagnostics
&tsConfigFilePath
.Here is the generated Vite config file:
Expected Behavior
The generated
vite.config.ts
file should not includeskipDiagnostics
andtsConfigFilePath
should be renamed totsconfigPath
(breaking changes since 3.0.0-beta.2 (2023-06-27)).GitHub Repo
https://github.com/nrwl/nx-examples
Steps to Reproduce
npx nx g @nx/js:lib mylib
and choosevite
as bundler.Nx Report
Failure Logs
Package Manager Version
pnpm v8.15.4
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: