Skip to content

Commit

Permalink
fix(#9): 0.4.0 breaks usage with globals: true
Browse files Browse the repository at this point in the history
* remove nodePolyfills
* update examples/ import
  • Loading branch information
thomasbrodusch committed Jul 22, 2023
1 parent 0134233 commit 59357f1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/support.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import failOnConsole from '../src';
import failOnConsole from '../dist/vitest-fail-on-console.es.js';
failOnConsole();
3 changes: 3 additions & 0 deletions examples/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@ export default defineConfig({
mockReset: true,
restoreMocks: true,
setupFiles: ['./support.ts'],
deps:{
inline: true
}
},
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"lint": "yarn eslint .",
"test": "vitest related ./tests/index.spec.ts --run",
"release": "standard-version",
"release:minor": "standard-version --release-as minor",
"release:patch": "standard-version --release-as patch",
"release:minor": "standard-version --release-as minor",
"release:major": "standard-version --release-as major"
},
"repository": {
Expand Down
7 changes: 4 additions & 3 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { resolve } from 'path';
import { defineConfig } from 'vite';
import dts from 'vite-plugin-dts';
import nodePolyfills from 'vite-plugin-node-stdlib-browser'


export default defineConfig({
Expand All @@ -13,17 +12,19 @@ export default defineConfig({
fileName: (format) => `vitest-fail-on-console.${format}.js`,
},
rollupOptions: {
external: ['chalk', 'util'],
external: ['chalk', 'util', 'vitest'],
output: {
globals: {
chalk: 'chalk',
vitest: 'vitest',
util: 'util'
},
sourcemap: true,
exports: 'named',
},
},
},
plugins: [dts(), nodePolyfills()],
plugins: [dts()],
test: {
environment: 'node',
globals: true,
Expand Down

0 comments on commit 59357f1

Please sign in to comment.