Skip to content

Commit

Permalink
feat(Esm): use gen-esm-wrapper instead of manually making the file
Browse files Browse the repository at this point in the history
  • Loading branch information
vladfrangu committed May 29, 2021
1 parent e300518 commit 14da0c1
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 113 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -20,3 +20,5 @@ deploy/deploy_key.pub
.idea/
docs/docs.json
typings/index.js
# Autogenerated
src/index.mjs
107 changes: 0 additions & 107 deletions esm/discord.mjs

This file was deleted.

96 changes: 93 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions package.json
Expand Up @@ -3,16 +3,17 @@
"version": "13.0.0-dev",
"description": "A powerful library for interacting with the Discord API",
"main": "./src/index.js",
"module": "./src/index.mjs",
"types": "./typings/index.d.ts",
"exports": {
".": [
{
"require": "./src/index.js",
"import": "./esm/discord.mjs"
"import": "./src/index.mjs"
},
"./src/index.js"
],
"./esm": "./esm/discord.mjs"
"./esm": "./src/index.mjs"
},
"scripts": {
"test": "npm run lint && npm run docs:test && npm run lint:typings",
Expand All @@ -23,7 +24,7 @@
"lint:fix": "eslint src --fix",
"lint:typings": "tslint typings/index.d.ts",
"prettier": "prettier --write src/**/*.js typings/**/*.ts",
"prepublishOnly": "pinst --disable && npm run test",
"prepublishOnly": "pinst --disable && npm run test && gen-esm-wrapper ./src/index.js ./src/index.mjs",
"prepare": "is-ci || husky install",
"postpublish": "pinst --enable"
},
Expand Down Expand Up @@ -69,6 +70,7 @@
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.23.3",
"eslint-plugin-prettier": "^3.4.0",
"gen-esm-wrapper": "^1.1.1",
"husky": "^6.0.0",
"is-ci": "^2.0.0",
"jest": "^26.6.3",
Expand Down

0 comments on commit 14da0c1

Please sign in to comment.