Skip to content

Commit

Permalink
Repace umd builds with cjs and iife builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Norman Rusch committed Apr 6, 2020
1 parent f69d407 commit a9e6d5f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "pacto",
"version": "0.4.5",
"description": "A lightweight framework for non SPA websites",
"main": "dist/pacto.umd.js",
"main": "dist/pacto.cjs.js",
"module": "dist/pacto.esm.js",
"keywords": [
"lightweight",
Expand Down
8 changes: 4 additions & 4 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ export default [
{
input: MODULE_ENTRY,
output: {
file: './dist/pacto.umd.js',
file: './dist/pacto.cjs.js',
name: MODULE_NAME,
format: 'umd'
format: 'cjs'
},
plugins: [babel()]
},
Expand All @@ -27,8 +27,8 @@ export default [
output: {
file: './dist/pacto.min.js',
name: MODULE_NAME,
format: 'umd'
format: 'iife'
},
plugins: [babel(), terser()]
}
},
];
11 changes: 3 additions & 8 deletions tests/dist.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as cjs from '../dist/pacto.cjs';
import * as esm from '../dist/pacto.esm';
import * as min from '../dist/pacto.min';
import * as umd from '../dist/pacto.umd';


const CLASSES = [
Expand All @@ -17,12 +16,8 @@ describe('The dist builds', () => {
expect(Object.keys(esm)).toEqual(CLASSES);
});

test('umd build exposes all pacto classes', () => {
expect(Object.keys(umd)).toEqual(CLASSES);
});

test('min build exposes all pacto classes', () => {
expect(Object.keys(min)).toEqual(CLASSES);
test('cjs build exposes all pacto classes', () => {
expect(Object.keys(cjs)).toEqual(CLASSES);
});

});

0 comments on commit a9e6d5f

Please sign in to comment.