Skip to content

Commit

Permalink
Use the cjs extension for all UMD builds
Browse files Browse the repository at this point in the history
  • Loading branch information
philipwalton committed Aug 31, 2022
1 parent ab67c29 commit a3e2180
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -553,7 +553,7 @@ The following table lists all the builds distributed with the `web-vitals` packa
</td>
</tr>
<tr>
<td><code>web-vitals.umd.js</code></td>
<td><code>web-vitals.umd.cjs</code></td>
<td><code>pgk.main</code></td>
<td>
A UMD version of the <code>web-vitals.js</code> bundle (exposed on the <code>window.webVitals.*</code> namespace).
Expand All @@ -574,7 +574,7 @@ The following table lists all the builds distributed with the `web-vitals` packa
</td>
</tr>
<tr>
<td><code>web-vitals.attribution.umd.js</code></td>
<td><code>web-vitals.attribution.umd.cjs</code></td>
<td>--</td>
<td>
A UMD version of the <code>web-vitals.attribution.js</code> build (exposed on the <code>window.webVitals.*</code> namespace).
Expand All @@ -598,7 +598,7 @@ The following table lists all the builds distributed with the `web-vitals` packa
</td>
</tr>
<tr>
<td><code>web-vitals.base.umd.js</code></td>
<td><code>web-vitals.base.umd.cjs</code></td>
<td>--</td>
<td>
<p><strong>This build has been <a href="https://github.com/GoogleChrome/web-vitals/issues/238">deprecated</a>.</strong></p>
Expand All @@ -619,7 +619,7 @@ The following table lists all the builds distributed with the `web-vitals` packa
<td>--</td>
<td>
<p><strong>This build has been <a href="https://github.com/GoogleChrome/web-vitals/issues/238">deprecated</a>.</strong></p>
<p>The "polyfill" part of the "base+polyfill" version. This script should be used with either <code>web-vitals.base.js</code>, <code>web-vitals.base.umd.js</code>, or <code>web-vitals.base.iife.js</code> (it will not work with any script that doesn't have "base" in the filename).</p>
<p>The "polyfill" part of the "base+polyfill" version. This script should be used with either <code>web-vitals.base.js</code>, <code>web-vitals.base.umd.cjs</code>, or <code>web-vitals.base.iife.js</code> (it will not work with any script that doesn't have "base" in the filename).</p>
See <a href="#how-to-use-the-polyfill">how to use the polyfill</a> for more details.
</td>
</tr>
Expand Down
12 changes: 6 additions & 6 deletions package.json
Expand Up @@ -4,32 +4,32 @@
"description": "Easily measure performance metrics in JavaScript",
"type": "module",
"typings": "dist/modules/index.d.ts",
"main": "dist/web-vitals.umd.js",
"main": "dist/web-vitals.umd.cjs",
"module": "dist/web-vitals.js",
"exports": {
".": {
"types": "./dist/modules/index.d.ts",
"require": "./dist/web-vitals.umd.js",
"require": "./dist/web-vitals.umd.cjs",
"default": "./dist/web-vitals.js"
},
"./base": {
"types": "./base.d.ts",
"require": "./dist/web-vitals.base.umd.js",
"require": "./dist/web-vitals.base.umd.cjs",
"default": "./dist/web-vitals.base.js"
},
"./base.js": {
"types": "./base.d.ts",
"require": "./dist/web-vitals.base.umd.js",
"require": "./dist/web-vitals.base.umd.cjs",
"default": "./dist/web-vitals.base.js"
},
"./attribution": {
"types": "./dist/modules/attribution.d.ts",
"require": "./dist/web-vitals.attribution.umd.js",
"require": "./dist/web-vitals.attribution.umd.cjs",
"default": "./dist/web-vitals.attribution.js"
},
"./attribution.js": {
"types": "./dist/modules/attribution.d.ts",
"require": "./dist/web-vitals.attribution.umd.js",
"require": "./dist/web-vitals.attribution.umd.cjs",
"default": "./dist/web-vitals.attribution.js"
},
"./onCLS.js": {
Expand Down
6 changes: 3 additions & 3 deletions rollup.config.js
Expand Up @@ -53,7 +53,7 @@ const configs = [
input: 'dist/modules/index.js',
output: {
format: 'umd',
file: `./dist/web-vitals.umd.js`,
file: `./dist/web-vitals.umd.cjs`,
name: 'webVitals',
},
plugins: configurePlugins({module: false, polyfill: false}),
Expand All @@ -79,7 +79,7 @@ const configs = [
input: 'dist/modules/index.js',
output: {
format: 'umd',
file: `./dist/web-vitals.base.umd.js`,
file: `./dist/web-vitals.base.umd.cjs`,
name: 'webVitals',
extend: true,
},
Expand Down Expand Up @@ -117,7 +117,7 @@ const configs = [
input: 'dist/modules/attribution.js',
output: {
format: 'umd',
file: `./dist/web-vitals.attribution.umd.js`,
file: `./dist/web-vitals.attribution.umd.cjs`,
name: 'webVitals',
},
plugins: configurePlugins({module: false, polyfill: false}),
Expand Down

0 comments on commit a3e2180

Please sign in to comment.