Skip to content

Commit

Permalink
feat: Bundle the audits into UMD for browser usage
Browse files Browse the repository at this point in the history
  • Loading branch information
enisdenjo committed Feb 12, 2023
1 parent 4ca7ee1 commit a402823
Showing 1 changed file with 48 additions and 23 deletions.
71 changes: 48 additions & 23 deletions rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,51 @@ import typescript from '@rollup/plugin-typescript';
import terser from '@rollup/plugin-terser';
import gzip from 'rollup-plugin-gzip';

export default {
input: './src/client.ts',
plugins: [typescript()],
output: [
{
file: './umd/graphql-http.js',
format: 'umd',
name: 'graphqlHttp',
},
{
file: './umd/graphql-http.min.js',
format: 'umd',
name: 'graphqlHttp',
plugins: [terser()],
},
{
file: './umd/graphql-http.min.js', // gzip plugin will add the .gz extension
format: 'umd',
name: 'graphqlHttp',
plugins: [terser(), gzip()],
},
],
};
export default [
{
input: './src/client.ts',
plugins: [typescript()],
output: [
{
file: './umd/graphql-http.js',
format: 'umd',
name: 'graphqlHttp',
},
{
file: './umd/graphql-http.min.js',
format: 'umd',
name: 'graphqlHttp',
plugins: [terser()],
},
{
file: './umd/graphql-http.min.js', // gzip plugin will add the .gz extension
format: 'umd',
name: 'graphqlHttp',
plugins: [terser(), gzip()],
},
],
},
{
input: './src/audits/index.ts',
plugins: [typescript()],
output: [
{
file: './umd/graphql-http-audits.js',
format: 'umd',
name: 'graphqlHttpAudits',
},
{
file: './umd/graphql-http-audits.min.js',
format: 'umd',
name: 'graphqlHttpAudits',
plugins: [terser()],
},
{
file: './umd/graphql-http-audits.min.js', // gzip plugin will add the .gz extension
format: 'umd',
name: 'graphqlHttpAudits',
plugins: [terser(), gzip()],
},
],
},
];

0 comments on commit a402823

Please sign in to comment.