Skip to content

Commit

Permalink
chore: do not include src folder in published package
Browse files Browse the repository at this point in the history
  • Loading branch information
toomuchdesign committed Dec 7, 2023
1 parent 7697e7f commit 83f20cc
Show file tree
Hide file tree
Showing 11 changed files with 1,193 additions and 21 deletions.
2 changes: 1 addition & 1 deletion jest/__snapshots__/bundles-snapshot.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Dist bundle is unchanged 1`] = `
exports[`UMD bundle is unchanged 1`] = `
"(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('reselect')) :
typeof define === 'function' && define.amd ? define(['exports', 'reselect'], factory) :
Expand Down
7 changes: 5 additions & 2 deletions jest/bundles-snapshot.test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import {readFileSync} from 'fs';
import {join} from 'path';

describe('Dist bundle', () => {
describe('UMD bundle', () => {
it('is unchanged', () => {
const bundle = readFileSync(join(__dirname, '..', 'dist/index.js'), 'utf8');
const bundle = readFileSync(
join(__dirname, '..', 'dist/umd/index.js'),
'utf8'
);
expect(bundle).toMatchSnapshot();
});
});
2 changes: 1 addition & 1 deletion jest/dist.config.js → jest/cjs.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ var pkg = require('../package.json');
module.exports = Object.assign({}, pkg.jest, {
rootDir: '../',
moduleNameMapper: {
'/src/index$': '<rootDir>/dist/index',
'/src/index$': '<rootDir>/dist/cjs/index',
},
});
2 changes: 1 addition & 1 deletion jest/es.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ var pkg = require('../package.json');
module.exports = Object.assign({}, pkg.jest, {
rootDir: '../',
moduleNameMapper: {
'/src/index$': '<rootDir>/es/index',
'/src/index$': '<rootDir>/dist/es/index',
},
});
2 changes: 1 addition & 1 deletion jest/lib.config.js → jest/umd.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ var pkg = require('../package.json');
module.exports = Object.assign({}, pkg.jest, {
rootDir: '../',
moduleNameMapper: {
'/src/index$': '<rootDir>/lib/index',
'/src/index$': '<rootDir>/dist/umd/index',
},
});
Loading

0 comments on commit 83f20cc

Please sign in to comment.