Skip to content

Commit

Permalink
package.json and webpack configs should point to index as the main, s…
Browse files Browse the repository at this point in the history
…ince that is where all the exports are that define the module (#78)
  • Loading branch information
geoffhendrey authored Sep 25, 2024
1 parent 347b1e5 commit a897231
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "0.1.32",
"license": "Apache-2.0",
"description": "JSONata embedded in JSON",
"main": "./dist/src/TemplateProcessor.js",
"module": "./dist/src/TemplateProcessor.js",
"main": "./dist/src/index.js",
"module": "./dist/src/index.js",
"exports": {
".": {
"import": "./dist/bundle.mjs",
Expand All @@ -17,6 +17,7 @@
"./dist/src/TestUtils.js": "./dist/src/TestUtils.js",
"./dist/src/DependencyFinder.js": "./dist/src/DependencyFinder.js",
"./dist/src/JsonPointer.js": "./dist/src/JsonPointer.js",
"./dist/src/utils/stringify.js": "./dist/src/utils/stringify.js",
"./dist/src/utils/debounce.js": "./dist/src/utils/debounce.js",
"./dist/src/utils/rateLimit.js": "./dist/src/utils/rateLimit.js"
},
Expand Down
8 changes: 8 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// src/index.ts

export { default } from './TemplateProcessor.js';
export * from './TemplateProcessor.js';
export * as MetaInfoProducer from './MetaInfoProducer.js';
export {default as JsonPointer} from './JsonPointer.js'
export {stringifyTemplateJSON} from './utils/stringify.js'

2 changes: 1 addition & 1 deletion webpack.config.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default {

devtool: 'source-map',
entry: {
main: './dist/src/TemplateProcessor.js'
main: './dist/src/index.js'
},
output: {
path: `${__dirname}/dist`, // Use __dirname here
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default {
devtool: 'source-map', //generate sourcemaps so other projects can debug into stated
mode: 'production',
entry: {
main: './dist/src/TemplateProcessor.js'
main: './dist/src/index.js'
},
output: {
path: `${__dirname}/dist`, // Use __dirname here
Expand Down

0 comments on commit a897231

Please sign in to comment.