Skip to content

Commit 8663214

Browse files
authored
Create ESM builds (#6)
1 parent 49eff60 commit 8663214

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

.babelrc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
2-
"presets": [
3-
"@babel/env"
4-
]
2+
"presets": ["@babel/env"],
3+
"env": {
4+
"production-esm": {
5+
"presets": [
6+
["@babel/env", { "modules": false }]
7+
]
8+
}
9+
}
510
}

package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@
22
"name": "detect-element-overflow",
33
"version": "1.1.1",
44
"description": "A function that tells you whether a given element is overflowing its container or not. Useful for creating dropdowns and tooltips.",
5-
"main": "dist/index.js",
6-
"es6": "src/index.js",
5+
"main": "dist/umd/index.js",
6+
"module": "dist/esm/index.js",
7+
"source": "src/index.js",
8+
"sideEffects": false,
79
"scripts": {
8-
"build": "babel src -d dist --ignore **/*.spec.js",
10+
"build": "yarn build-esm && yarn build-umd",
11+
"build-esm": "BABEL_ENV=production-esm babel src -d dist/esm --ignore **/*.spec.js",
12+
"build-umd": "BABEL_ENV=production-umd babel src -d dist/umd --ignore **/*.spec.js",
913
"clean": "rimraf dist",
1014
"lint": "eslint src/ --ext .jsx,.js",
1115
"prepublishOnly": "yarn clean && yarn build",

0 commit comments

Comments
 (0)