Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the cjs extension for all UMD builds #257

Merged
merged 1 commit into from Aug 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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