Skip to content

Commit

Permalink
build: add umd/index.js for es2017+
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurfiorette committed Jan 13, 2022
1 parent 1ccfad3 commit 7f3a153
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
11 changes: 6 additions & 5 deletions build/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ const root = (...p) => path.resolve(__dirname, '..', ...p);
/**
* @param {{
* output: string;
* entry: string;
* esTarget: string;
* }} options
* @returns {import('webpack').Configuration}
*/
const config = ({ output, esTarget, entry }) => ({
const config = ({ output, esTarget }) => ({
mode: 'production',

entry: root('src', entry),
entry: root('src', 'index.ts'),

output: {
path: root(),
Expand Down Expand Up @@ -64,12 +63,14 @@ const config = ({ output, esTarget, entry }) => ({
module.exports = [
config({
esTarget: 'es2015', //es6
entry: 'index.ts',
output: 'umd/es6.min'
}),
config({
esTarget: 'es5',
entry: 'index.ts',
output: 'umd/es5.min'
}),
config({
esTarget: 'es2017',
output: 'umd/index'
})
];
1 change: 1 addition & 0 deletions docs/pages/compiled-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ CommonsJS, ESM and more)

- `axios-cache-interceptor/umd/es6.min.js`: Production file for ES6+
- `axios-cache-interceptor/umd/es5.min.js`: Production file for ES5+
- `axios-cache-interceptor/umd/index.js`: Production file for ES2017+

```html
<!-- You can use the cdn of your choice -->
Expand Down

0 comments on commit 7f3a153

Please sign in to comment.