created exports in pkg json and esm browser bundle that removes nodejs dependencies
This commit is contained in:
14
bundle.js
14
bundle.js
@@ -37,6 +37,20 @@ const runBuild = async () => {
|
||||
console.log(e);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
build({
|
||||
entryPoints: ['./src/index.ts'],
|
||||
minify: false,
|
||||
bundle: true,
|
||||
outfile: './bundles/esm.bundle.js',
|
||||
platform: 'browser',
|
||||
target: ['es2020', 'chrome58', 'firefox57', 'safari11'],
|
||||
format: 'esm',
|
||||
globalName: 'rsdk'
|
||||
}).catch((e) => {
|
||||
console.log(e);
|
||||
process.exit(1);
|
||||
});
|
||||
};
|
||||
runBuild();
|
||||
|
||||
|
||||
@@ -5,6 +5,14 @@
|
||||
"main": "./lib/cjs/index.js",
|
||||
"module": "./lib/esm/index.js",
|
||||
"types": "./lib/types/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./lib/esm/index.js",
|
||||
"require": "./lib/cjs/index.js"
|
||||
},
|
||||
"./esm": "bundles/esm.bundle.js",
|
||||
"./web": "bundles/web.bundle.js"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"engines": {
|
||||
"node": ">=16.5"
|
||||
|
||||
Reference in New Issue
Block a user