-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(): use rollup to create ESM and CommonJS bundles
- Loading branch information
1 parent
fdda7ec
commit dfd8528
Showing
6 changed files
with
48 additions
and
48 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,7 @@ | ||
{ | ||
"env": { | ||
"test": { | ||
"presets": [ | ||
["@babel/env"] | ||
], | ||
"plugins": ["rewire"], | ||
"sourceMaps": "inline" | ||
}, | ||
"es5": { | ||
"presets": [ | ||
["@babel/env"] | ||
], | ||
"plugins": [ | ||
"add-module-exports" | ||
] | ||
}, | ||
"es-modules": { | ||
"presets": [ | ||
["@babel/env", { | ||
"modules": false | ||
}] | ||
] | ||
} | ||
} | ||
"presets": [ | ||
["@babel/env"] | ||
], | ||
"plugins": ["rewire"], | ||
"sourceMaps": "inline" | ||
} |
This file was deleted.
Oops, something went wrong.
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 @@ | ||
export { default as createHttpClient } from './create-http-client' | ||
export { default as createRequestConfig } from './create-request-config' | ||
export { default as enforceObjPath } from './enforce-obj-path' | ||
export { default as freezeSys } from './freeze-sys' | ||
export { default as getUserAgentHeader } from './get-user-agent' | ||
export { default as toPlainObject } from './to-plain-object' |
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,28 @@ | ||
import pkg from './package.json'; | ||
import babel from 'rollup-plugin-babel'; | ||
|
||
export default [ | ||
{ | ||
input: 'lib/index.js', | ||
output: [ | ||
{ file: pkg.module, format: 'esm' }, | ||
{ file: pkg.main, format: 'cjs' }, | ||
], | ||
plugins: [ | ||
babel({ | ||
babelrc: false, | ||
presets: [ | ||
['@babel/env', { | ||
modules: false | ||
}] | ||
] | ||
}) | ||
], | ||
external: [ | ||
...Object.keys(pkg.dependencies || []), | ||
'os', | ||
'lodash/isPlainObject', | ||
'lodash/cloneDeep' | ||
] | ||
} | ||
]; |