Skip to content

Commit 71de794

Browse files
committed
remove iife build
1 parent 032f2f8 commit 71de794

File tree

8 files changed

+54
-131
lines changed

8 files changed

+54
-131
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
dist/
2-
lib/
32
docs/
43
coverage/

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ npm-debug.log
77
yarn-error.log
88
.idea/
99
node_modules/
10-
lib/
1110
dist/
1211
.docz/
1312
coverage/

.size-snapshot.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
{
2-
"dist/index.js": {
3-
"bundled": 7333,
4-
"minified": 7333,
5-
"gzipped": 2207
6-
},
7-
"lib/cjs/index.js": {
2+
"dist/cjs/react-popper-tooltip.js": {
83
"bundled": 13954,
94
"minified": 7653,
105
"gzipped": 2137
116
},
12-
"lib/esm/index.js": {
7+
"dist/esm/react-popper-tooltip.js": {
138
"bundled": 13902,
149
"minified": 7620,
1510
"gzipped": 2132,

README.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
# React Tooltip
22
[![npm version](https://img.shields.io/npm/v/react-popper-tooltip.svg?style=flat-square)](https://www.npmjs.com/package/react-popper-tooltip)
33
[![npm downloads](https://img.shields.io/npm/dm/react-popper-tooltip.svg?style=flat-square)](https://www.npmjs.com/package/react-popper-tooltip)
4-
[![Build Status](https://img.shields.io/travis/com/mohsinulhaq/react-popper-tooltip.svg?colorB=purple&style=flat-square&logo=travis)](https://travis-ci.com/mohsinulhaq/react-popper-tooltip)
4+
[![Build Status](https://travis-ci.com/mohsinulhaq/react-popper-tooltip.svg?branch=master)](https://travis-ci.com/mohsinulhaq/react-popper-tooltip)
55
[![Dependency Status](https://img.shields.io/david/mohsinulhaq/react-popper-tooltip.svg?style=flat-square)](https://david-dm.org/mohsinulhaq/react-popper-tooltip)
66
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
7-
[![Greenkeeper badge](https://badges.greenkeeper.io/mohsinulhaq/react-popper-tooltip.svg)](https://greenkeeper.io/)
87
[![codecov](https://codecov.io/gh/mohsinulhaq/react-popper-tooltip/branch/master/graph/badge.svg)](https://codecov.io/gh/mohsinulhaq/react-popper-tooltip)
9-
![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)
108

119
React tooltip component based on [react-popper](https://github.com/FezVrasta/react-popper), the
1210
React wrapper around [popper.js](https://popper.js.org/) library.
@@ -26,10 +24,6 @@ or
2624
```bash
2725
yarn add react-popper-tooltip
2826
```
29-
or
30-
```html
31-
<script src="https://unpkg.com/react-popper-tooltip"></script>
32-
```
3327

3428
```jsx
3529
import React from 'react';

babel.config.js

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,7 @@
11
module.exports = {
2-
presets: [
3-
[
4-
'@babel/env',
5-
{
6-
modules: false,
7-
loose: true
8-
}
9-
],
10-
'@babel/react'
11-
],
2+
presets: [['@babel/env', {loose: true}], '@babel/react'],
123
plugins: [
134
['@babel/proposal-class-properties', {loose: true}],
145
['transform-react-remove-prop-types', {removeImport: true}]
15-
],
16-
env: {
17-
test: {
18-
presets: ['@babel/env']
19-
}
20-
}
6+
]
217
};

package.json

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,19 @@
77
"type": "git",
88
"url": "https://github.com/mohsinulhaq/react-popper-tooltip"
99
},
10-
"browser": "lib/cjs/index.js",
11-
"main": "lib/cjs/index.js",
12-
"module": "lib/esm/index.js",
13-
"unpkg": "dist/index.js",
10+
"main": "dist/cjs/react-popper-tooltip.js",
11+
"module": "dist/esm/react-popper-tooltip.js",
1412
"style": "dist/styles.css",
1513
"typings": "typings/react-popper-tooltip.d.ts",
1614
"files": [
17-
"lib",
1815
"dist",
1916
"typings/react-popper-tooltip.d.ts"
2017
],
2118
"sideEffects": [
2219
"*.css"
2320
],
2421
"scripts": {
25-
"build": "rimraf dist lib && rollup -c && cp src/styles.css dist",
22+
"build": "rimraf dist && rollup -c && cp src/styles.css dist",
2623
"prepublishOnly": "yarn lint && yarn test && yarn build",
2724
"docs": "docz dev",
2825
"docs:build": "docz build",
@@ -86,8 +83,6 @@
8683
"rimraf": "^2.6.2",
8784
"rollup": "^0.68.2",
8885
"rollup-plugin-babel": "^4.1.0",
89-
"rollup-plugin-node-resolve": "^4.0.0",
90-
"rollup-plugin-size-snapshot": "^0.7.0",
91-
"rollup-plugin-terser": "^3.0.0"
86+
"rollup-plugin-size-snapshot": "^0.7.0"
9287
}
9388
}

rollup.config.js

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,10 @@
11
import babel from 'rollup-plugin-babel';
2-
import resolve from 'rollup-plugin-node-resolve';
3-
import {terser} from 'rollup-plugin-terser';
42
import {sizeSnapshot} from 'rollup-plugin-size-snapshot';
53
import pkg from './package.json';
64

75
const input = 'src/index.js';
8-
const name = 'TooltipTrigger';
9-
const globals = {
10-
react: 'React',
11-
'react-dom': 'ReactDOM',
12-
'react-popper': 'ReactPopper'
13-
};
146
const external = id => !id.startsWith('.') && !id.startsWith('/');
15-
const getBabelOptions = ({useESModules = true} = {}) => ({
16-
exclude: 'node_modules/**',
7+
const getBabelOptions = (useESModules = true) => ({
178
runtimeHelpers: true,
189
plugins: [['@babel/plugin-transform-runtime', {useESModules}]]
1910
});
@@ -22,31 +13,18 @@ export default [
2213
{
2314
input,
2415
output: {
25-
name,
26-
file: 'dist/index.js',
27-
format: 'iife',
28-
globals,
29-
interop: false
30-
},
31-
external: Object.keys(globals),
32-
plugins: [resolve(), babel(getBabelOptions()), terser(), sizeSnapshot()]
33-
},
34-
{
35-
input,
36-
output: {
37-
file: pkg.browser,
16+
file: pkg.main,
3817
format: 'cjs',
3918
interop: false
4019
},
4120
external,
42-
plugins: [babel(getBabelOptions({useESModules: false})), sizeSnapshot()]
21+
plugins: [babel(getBabelOptions(false)), sizeSnapshot()]
4322
},
4423
{
4524
input,
4625
output: {
4726
file: pkg.module,
48-
format: 'esm',
49-
interop: false
27+
format: 'esm'
5028
},
5129
external,
5230
plugins: [babel(getBabelOptions()), sizeSnapshot()]

yarn.lock

Lines changed: 41 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -2528,11 +2528,6 @@ builtin-modules@^1.0.0:
25282528
resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f"
25292529
integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=
25302530

2531-
builtin-modules@^3.0.0:
2532-
version "3.0.0"
2533-
resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.0.0.tgz#1e587d44b006620d90286cc7a9238bbc6129cab1"
2534-
integrity sha512-hMIeU4K2ilbXV6Uv93ZZ0Avg/M91RaKXucQ+4me2Do1txxBDyDZWCBa5bJSLqoNTRpXTLwEzIk1KmloenDDjhg==
2535-
25362531
builtin-status-codes@^3.0.0:
25372532
version "3.0.0"
25382533
resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8"
@@ -2732,9 +2727,9 @@ caniuse-api@^3.0.0:
27322727
lodash.uniq "^4.5.0"
27332728

27342729
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000884, caniuse-lite@^1.0.30000921:
2735-
version "1.0.30000923"
2736-
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000923.tgz#148f9bda508024b5ce957b463ae2e8302b451bb2"
2737-
integrity sha512-j5ur7eeluOFjjPUkydtXP4KFAsmH3XaQNch5tvWSO+dLHYt5PE+VgJZLWtbVOodfWij6m6zas28T4gB/cLYq1w==
2730+
version "1.0.30000925"
2731+
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000925.tgz#f1a3b9aae2a83071b1eccfa39959d72440409b08"
2732+
integrity sha512-zcYupoUxtW46rOikuDF7vfL9N1Qe9ZuUBTz3n3q8fFsoJIs/h9UN6Vg/0QpjsmvImXw9mVc3g+ZBfqvUz/iALA==
27382733

27392734
capitalize@^2.0.0:
27402735
version "2.0.0"
@@ -3691,9 +3686,9 @@ cssstyle@^1.0.0:
36913686
cssom "0.3.x"
36923687

36933688
csstype@^2.2.0, csstype@^2.5.7:
3694-
version "2.5.8"
3695-
resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.5.8.tgz#4ce5aa16ea0d562ef9105fa3ae2676f199586a35"
3696-
integrity sha512-r4DbsyNJ7slwBSKoGesxDubRWJ71ghG8W2+1HcsDlAo12KGca9dDLv0u98tfdFw7ldBdoA7XmCnI6Q8LpAJXaQ==
3689+
version "2.6.0"
3690+
resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.0.tgz#6cf7b2fa7fc32aab3d746802c244d4eda71371a2"
3691+
integrity sha512-by8hi8BlLbowQq0qtkx54d9aN73R9oUW20HISpka5kmgsR9F7nnxgfsemuR2sdCKZh+CDNf5egW9UZMm4mgJRg==
36973692

36983693
currently-unhandled@^0.4.1:
36993694
version "0.4.1"
@@ -4480,9 +4475,9 @@ entities@~1.1.1:
44804475
integrity sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==
44814476

44824477
env-dot-prop@^1.0.2:
4483-
version "1.1.1"
4484-
resolved "https://registry.yarnpkg.com/env-dot-prop/-/env-dot-prop-1.1.1.tgz#f06cb73e3ebff101192fee5143efa7507b88ae3b"
4485-
integrity sha512-lpC58NLAg6ukY2DRZ9YX4D/fCWde0hYvpFZA9VKComsfo+9/jPGOOPUu9lmH/YVE/jOSnHJ03I2LlRg0q4rtLA==
4478+
version "1.1.2"
4479+
resolved "https://registry.yarnpkg.com/env-dot-prop/-/env-dot-prop-1.1.2.tgz#23e17015f91f26269f8e4448a1195f67653bac6f"
4480+
integrity sha512-u0997EBxFSEVk+wmlXoUbQdheyZQe7rpCEtzGQL5apDH3ssgwpx6eZ0MeCcMWB1pl8m1hdQOb6I+bBWsuMvEhw==
44864481
dependencies:
44874482
circular-json "^0.5.9"
44884483
dot-prop "^4.2.0"
@@ -4839,6 +4834,19 @@ execa@^0.8.0:
48394834
signal-exit "^3.0.0"
48404835
strip-eof "^1.0.0"
48414836

4837+
execa@^1.0.0:
4838+
version "1.0.0"
4839+
resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8"
4840+
integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==
4841+
dependencies:
4842+
cross-spawn "^6.0.0"
4843+
get-stream "^4.0.0"
4844+
is-stream "^1.1.0"
4845+
npm-run-path "^2.0.0"
4846+
p-finally "^1.0.0"
4847+
signal-exit "^3.0.0"
4848+
strip-eof "^1.0.0"
4849+
48424850
exit-on-epipe@~1.0.1:
48434851
version "1.0.1"
48444852
resolved "https://registry.yarnpkg.com/exit-on-epipe/-/exit-on-epipe-1.0.1.tgz#0bdd92e87d5285d267daa8171d0eb06159689692"
@@ -5476,6 +5484,13 @@ get-stream@^3.0.0:
54765484
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14"
54775485
integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=
54785486

5487+
get-stream@^4.0.0:
5488+
version "4.1.0"
5489+
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5"
5490+
integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==
5491+
dependencies:
5492+
pump "^3.0.0"
5493+
54795494
get-value@^2.0.3, get-value@^2.0.6:
54805495
version "2.0.6"
54815496
resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28"
@@ -6579,11 +6594,6 @@ is-lower-case@^1.1.0:
65796594
dependencies:
65806595
lower-case "^1.1.0"
65816596

6582-
is-module@^1.0.0:
6583-
version "1.0.0"
6584-
resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591"
6585-
integrity sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=
6586-
65876597
is-npm@^1.0.0:
65886598
version "1.0.0"
65896599
resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-1.0.0.tgz#f2fb63a65e4905b406c86072765a1a4dc793b9f4"
@@ -7640,9 +7650,9 @@ [email protected]:
76407650
json5 "^0.5.0"
76417651

76427652
loader-utils@^1.0.1, loader-utils@^1.0.2, loader-utils@^1.1.0:
7643-
version "1.2.1"
7644-
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.2.1.tgz#64bbbac69aa5840d03754ba676a963dec568e844"
7645-
integrity sha512-3Zhx4qDqBQ9U8udWB3RMJ29nLu5a3ObNOSzk87woPvge01pi0wABowgv7F79Z4mL0DGtHRi/oOndT34EVhInoQ==
7653+
version "1.2.3"
7654+
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.2.3.tgz#1ff5dc6911c9f0a062531a4c04b609406108c2c7"
7655+
integrity sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA==
76467656
dependencies:
76477657
big.js "^5.2.2"
76487658
emojis-list "^2.0.0"
@@ -8930,11 +8940,11 @@ os-locale@^2.0.0:
89308940
mem "^1.1.0"
89318941

89328942
os-locale@^3.0.0:
8933-
version "3.0.1"
8934-
resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.0.1.tgz#3b014fbf01d87f60a1e5348d80fe870dc82c4620"
8935-
integrity sha512-7g5e7dmXPtzcP4bgsZ8ixDVqA7oWYuEz4lOSujeWyliPai4gfVDiFIcwBg3aGCPnmSGfzOKTK3ccPn0CKv3DBw==
8943+
version "3.1.0"
8944+
resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.1.0.tgz#a802a6ee17f24c10483ab9935719cef4ed16bf1a"
8945+
integrity sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==
89368946
dependencies:
8937-
execa "^0.10.0"
8947+
execa "^1.0.0"
89388948
lcid "^2.0.0"
89398949
mem "^4.0.0"
89408950

@@ -10905,15 +10915,6 @@ rollup-plugin-babel@^4.1.0:
1090510915
"@babel/helper-module-imports" "^7.0.0"
1090610916
rollup-pluginutils "^2.3.0"
1090710917

10908-
rollup-plugin-node-resolve@^4.0.0:
10909-
version "4.0.0"
10910-
resolved "https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-4.0.0.tgz#9bc6b8205e9936cc0e26bba2415f1ecf1e64d9b2"
10911-
integrity sha512-7Ni+/M5RPSUBfUaP9alwYQiIKnKeXCOHiqBpKUl9kwp3jX5ZJtgXAait1cne6pGEVUUztPD6skIKH9Kq9sNtfw==
10912-
dependencies:
10913-
builtin-modules "^3.0.0"
10914-
is-module "^1.0.0"
10915-
resolve "^1.8.1"
10916-
1091710918
rollup-plugin-replace@^2.0.0:
1091810919
version "2.1.0"
1091910920
resolved "https://registry.yarnpkg.com/rollup-plugin-replace/-/rollup-plugin-replace-2.1.0.tgz#f9c07a4a89a2f8be912ee54b3f0f68d91e9ed0ae"
@@ -10938,16 +10939,6 @@ rollup-plugin-size-snapshot@^0.7.0:
1093810939
terser "^3.8.2"
1093910940
webpack "^4.19.0"
1094010941

10941-
rollup-plugin-terser@^3.0.0:
10942-
version "3.0.0"
10943-
resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-3.0.0.tgz#045bd7cf625ee1affcfe6971dab6fffe6fb48c65"
10944-
integrity sha512-Ed9zRD7OoCBnh0XGlEAJle5TCUsFXMLClwKzZWnS1zbNO4MelHjfCSdFZxCAdH70M40nhZ1nRrY2GZQJhSMcjA==
10945-
dependencies:
10946-
"@babel/code-frame" "^7.0.0"
10947-
jest-worker "^23.2.0"
10948-
serialize-javascript "^1.5.0"
10949-
terser "^3.8.2"
10950-
1095110942
rollup-pluginutils@^2.0.1, rollup-pluginutils@^2.3.0:
1095210943
version "2.3.3"
1095310944
resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.3.3.tgz#3aad9b1eb3e7fe8262820818840bf091e5ae6794"
@@ -11171,10 +11162,10 @@ serialize-error@^2.1.0:
1117111162
resolved "https://registry.yarnpkg.com/serialize-error/-/serialize-error-2.1.0.tgz#50b679d5635cdf84667bdc8e59af4e5b81d5f60a"
1117211163
integrity sha1-ULZ51WNc34Rme9yOWa9OW4HV9go=
1117311164

11174-
serialize-javascript@^1.4.0, serialize-javascript@^1.5.0:
11175-
version "1.6.0"
11176-
resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.6.0.tgz#b30ce5ddd6517f2c445e129ff5834a399fb5861e"
11177-
integrity sha512-AQxrNqu4EXWt03dJdgKXI+Au9+pvEuM5+Nk5g6+TmuxMCkEL03VhZ31HM+VKeaaZbFpDHaoSruiHq4PW9AIrOQ==
11165+
serialize-javascript@^1.4.0:
11166+
version "1.6.1"
11167+
resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.6.1.tgz#4d1f697ec49429a847ca6f442a2a755126c4d879"
11168+
integrity sha512-A5MOagrPFga4YaKQSWHryl7AXvbQkEqpw4NNYMTNYUNV51bA8ABHgYFpqKx+YFFrw59xMV1qGH1R4AgoNIVgCw==
1117811169

1117911170
serve-index@^1.7.2:
1118011171
version "1.9.1"
@@ -11984,21 +11975,7 @@ term-size@^1.2.0:
1198411975
dependencies:
1198511976
execa "^0.7.0"
1198611977

11987-
terser-webpack-plugin@^1.1.0:
11988-
version "1.2.0"
11989-
resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-1.2.0.tgz#24697213f2128009080f39f081c18cb2221d91ff"
11990-
integrity sha512-QW7RACLS89RalHtLDb0s8+Iqcs/IAEw1rnVrV+mS7Gx1kgPG8o1g33JhAGDgc/CQ84hLsTW5WrAMdVysh692yg==
11991-
dependencies:
11992-
cacache "^11.0.2"
11993-
find-cache-dir "^2.0.0"
11994-
schema-utils "^1.0.0"
11995-
serialize-javascript "^1.4.0"
11996-
source-map "^0.6.1"
11997-
terser "^3.8.1"
11998-
webpack-sources "^1.1.0"
11999-
worker-farm "^1.5.2"
12000-
12001-
terser-webpack-plugin@^1.2.0:
11978+
terser-webpack-plugin@^1.1.0, terser-webpack-plugin@^1.2.0:
1200211979
version "1.2.1"
1200311980
resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-1.2.1.tgz#7545da9ae5f4f9ae6a0ac961eb46f5e7c845cc26"
1200411981
integrity sha512-GGSt+gbT0oKcMDmPx4SRSfJPE1XaN3kQRWG4ghxKQw9cn5G9x6aCKSsgYdvyM0na9NJ4Drv0RG6jbBByZ5CMjw==

0 commit comments

Comments
 (0)