Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into release-fixes-cont
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesHenry committed Nov 29, 2023
2 parents 48c31e0 + 6317219 commit 5e31875
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 62 deletions.
Original file line number Diff line number Diff line change
@@ -1,66 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`lib --bundler=vite should add build and test targets with vite and vitest 1`] = `
"/// <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/my-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/my-lib',
lib: {
// Could also be a dictionary or array of multiple entry points.
entry: 'src/index.ts',
name: 'my-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: [],
},
},
test: {
globals: true,
cache: {
dir: '../node_modules/.vitest',
},
environment: 'jsdom',
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
coverage: {
reportsDirectory: '../coverage/my-lib',
provider: 'v8',
},
},
});
"
`;

exports[`lib --unit-test-runner jest should generate test configuration with swc and js 1`] = `
"/* eslint-disable */
const { readFileSync } = require('fs');
Expand Down
2 changes: 1 addition & 1 deletion packages/js/src/generators/library/library.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,7 @@ describe('lib', () => {
expect(project.targets.test).toMatchObject({
executor: '@nx/vite:test',
});
expect(tree.read('my-lib/vite.config.ts', 'utf-8')).toMatchSnapshot();
expect(tree.exists('my-lib/vite.config.ts')).toBeTruthy();
expect(readJson(tree, 'my-lib/.eslintrc.json').overrides).toContainEqual({
files: ['*.json'],
parser: 'jsonc-eslint-parser',
Expand Down

0 comments on commit 5e31875

Please sign in to comment.