From 53bd95de1c737c2eb0539103018ac383d78b9937 Mon Sep 17 00:00:00 2001 From: pfych Date: Tue, 13 Jun 2023 12:41:52 +1000 Subject: [PATCH] Fix export issue --- build.js | 2 ++ package.json | 2 +- src/index.ts | 6 ++---- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build.js b/build.js index 5e4fee8..5575f6e 100644 --- a/build.js +++ b/build.js @@ -3,6 +3,7 @@ const { build } = require('esbuild'); const shared = { entryPoints: ['src/index.ts'], bundle: true, + minify: true, }; (async () => { @@ -10,6 +11,7 @@ const shared = { build({ ...shared, outfile: 'dist/index.js', + format: 'cjs', }), build({ ...shared, diff --git a/package.json b/package.json index 874bcf9..8c30bdb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pfych-table", - "version": "1.0.5", + "version": "1.0.6", "description": "Generate a sortable HTML Table based off of config & a data object", "homepage": "https://github.com/pfych/pfych-table", "author": "Pfych (https://pfy.ch)", diff --git a/src/index.ts b/src/index.ts index e811f31..e0b7c27 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,6 @@ import { Column } from './types'; -const createSortableTable = (table: Element): void => { +export const createSortableTable = (table: Element): void => { let lastClicked = ''; const sortRows = (sortBy: string, header: Element, rows: Element[]) => { @@ -59,7 +59,7 @@ const createSortableTable = (table: Element): void => { }); }; -const renderTable = (args: { +export const renderTable = (args: { columns: Column[]; data: T[]; sortable?: boolean; @@ -112,5 +112,3 @@ const renderTable = (args: { return wrapper; }; - -export { renderTable, createSortableTable, Column };