Skip to content

Commit

Permalink
Merge pull request #7 from tradingview/6-commonjs-modules
Browse files Browse the repository at this point in the history
Define module format and entry points in package.json
  • Loading branch information
Nipheris committed Aug 13, 2021
2 parents bad0934 + ade80df commit 9c6a720
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,10 @@
],
"author": "smakarov@tradingview.com",
"license": "MIT",
"private": true
"private": true,
"type": "module",
"module": "./index.js",
"exports": {
"import": "./index.js"
}
}
6 changes: 4 additions & 2 deletions tools/build-package-json.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
var fs = require('fs');
var path = require('path');

var args = process.argv.slice(2);
var inputPath = args[0];
Expand Down Expand Up @@ -29,10 +28,13 @@ var output = {
cpu: input.cpu,
os: input.os,

// entry points
// module format and entry points
bin: input.bin,
exports: input.exports,
main: input.main,
man: input.man,
module: input.module,
type: input.type,

// contents
files: ["**/*.js", "**/*.d.ts"],
Expand Down

0 comments on commit 9c6a720

Please sign in to comment.