-
Notifications
You must be signed in to change notification settings - Fork 404
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add rollup config * Sort dependencies in package.json * Clean output folder before build * Use relative paths for entries * Convert cjs to esm if needed * Add extensions to lodash imports To support node16 resolution * Ignore coverage for vitest and jest-globals
- Loading branch information
Showing
7 changed files
with
100 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
const del = require('rollup-plugin-delete') | ||
const commonjs = require('@rollup/plugin-commonjs') | ||
|
||
const entries = [ | ||
'./src/index.js', | ||
'./src/jest-globals.js', | ||
'./src/matchers.js', | ||
'./src/vitest.js', | ||
] | ||
|
||
module.exports = [ | ||
{ | ||
input: entries, | ||
output: [ | ||
{ | ||
dir: 'dist', | ||
entryFileNames: '[name].mjs', | ||
chunkFileNames: '[name]-[hash].mjs', | ||
format: 'esm', | ||
}, | ||
{ | ||
dir: 'dist', | ||
entryFileNames: '[name].js', | ||
chunkFileNames: '[name]-[hash].js', | ||
format: 'cjs', | ||
}, | ||
], | ||
external: id => | ||
!id.startsWith('\0') && !id.startsWith('.') && !id.startsWith('/'), | ||
plugins: [del({targets: 'dist/*'}), commonjs()], | ||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* istanbul ignore file */ | ||
|
||
import globals from '@jest/globals' | ||
import * as extensions from './matchers' | ||
|
||
globals.expect.extend(extensions) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* istanbul ignore file */ | ||
|
||
import {expect} from 'vitest' | ||
import * as extensions from './matchers' | ||
|
||
expect.extend(extensions) |