-
-
Notifications
You must be signed in to change notification settings - Fork 681
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add rollup export dual package * test: command to run a specific test * feat: export more, make it work without having to write const formidable = require('formidable/index.cjs'); * doc: changelog and version * doc: add note to readme
- Loading branch information
1 parent
d90b69d
commit 009d3f2
Showing
5 changed files
with
293 additions
and
5 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
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,105 @@ | ||
/* eslint-disable */ | ||
import cjs from '@rollup/plugin-commonjs'; | ||
import { nodeResolve } from '@rollup/plugin-node-resolve'; | ||
import packageJson from '../package.json' assert {type: "json"};; | ||
|
||
const {dependencies} = packageJson; | ||
const plugins = [nodeResolve(), cjs()]; | ||
const cjsOptions = { | ||
format: `cjs`, | ||
exports: `named`, | ||
} | ||
|
||
const external = [...Object.keys(dependencies)]; | ||
|
||
export default [ | ||
{ | ||
input: `src/index.js`, | ||
output: [ | ||
{ | ||
file: `dist/index.cjs`, | ||
...cjsOptions, | ||
}, | ||
], | ||
external, | ||
plugins, | ||
}, | ||
{ | ||
input: `src/helpers/firstValues.js`, | ||
output: [ | ||
{ | ||
file: `dist/helpers/firstValues.cjs`, | ||
...cjsOptions, | ||
}, | ||
], | ||
external, | ||
plugins, | ||
}, | ||
{ | ||
input: `src/helpers/readBooleans.js`, | ||
output: [ | ||
{ | ||
file: `dist/helpers/readBooleans.cjs`, | ||
...cjsOptions, | ||
}, | ||
], | ||
external, | ||
plugins, | ||
}, | ||
{ | ||
input: `src/parsers/JSON.js`, | ||
output: [ | ||
{ | ||
file: `dist/parsers/JSON.cjs`, | ||
...cjsOptions, | ||
}, | ||
], | ||
external, | ||
plugins, | ||
}, | ||
{ | ||
input: `src/parsers/Multipart.js`, | ||
output: [ | ||
{ | ||
file: `dist/parsers/Multipart.cjs`, | ||
...cjsOptions, | ||
}, | ||
], | ||
external, | ||
plugins, | ||
}, | ||
{ | ||
input: `src/parsers/Querystring.js`, | ||
output: [ | ||
{ | ||
file: `dist/parsers/Querystring.cjs`, | ||
...cjsOptions, | ||
}, | ||
], | ||
external, | ||
plugins, | ||
}, | ||
{ | ||
input: `src/parsers/OctetStream.js`, | ||
output: [ | ||
{ | ||
file: `dist/parsers/OctetStream.cjs`, | ||
...cjsOptions, | ||
}, | ||
], | ||
external, | ||
plugins, | ||
}, | ||
{ | ||
input: `src/parsers/StreamingQuerystring.js`, | ||
output: [ | ||
{ | ||
file: `dist/parsers/StreamingQuerystring.cjs`, | ||
...cjsOptions, | ||
}, | ||
], | ||
external, | ||
plugins, | ||
}, | ||
]; | ||
|
Oops, something went wrong.