Skip to content

Commit

Permalink
Fix: rename UMD files to .min.cjs (katspaugh#2906)
Browse files Browse the repository at this point in the history
* Fix: rename UMD files to .min.cjs

* Beta 9
  • Loading branch information
katspaugh committed Jun 18, 2023
1 parent 4a7b8b6 commit ffcdffc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Alternatively, import it from a CDN as a ES6 module directly in the browser:

Or, as a UMD script tag which exports the library as a global `WaveSurfer` variable:
```html
<script src="https://unpkg.com/wavesurfer.js@beta/dist/wavesurfer.min.js"></script>
<script src="https://unpkg.com/wavesurfer.js@beta/dist/wavesurfer.min.cjs"></script>
```

To import a plugin, e.g. the Timeline plugin:
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wavesurfer.js",
"version": "7.0.0-beta.8",
"version": "7.0.0-beta.9",
"license": "BSD-3-Clause",
"author": "katspaugh",
"description": "Navigable audio waveform player",
Expand All @@ -26,15 +26,15 @@
"exports": {
".": {
"import": "./dist/wavesurfer.js",
"require": "./dist/wavesurfer.min.js"
"require": "./dist/wavesurfer.min.cjs"
},
"./plugins/*.js": {
"import": "./dist/plugins/*.js",
"require": "./dist/plugins/*.min.js"
"require": "./dist/plugins/*.min.cjs"
},
"./dist/plugins/*.js": {
"import": "./dist/plugins/*.js",
"require": "./dist/plugins/*.min.js"
"require": "./dist/plugins/*.min.cjs"
},
"./dist/*": {
"import": "./dist/*"
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default {
libraryTarget: 'umd',
libraryExport: 'default',
globalObject: 'this',
filename: '[name].min.js',
filename: '[name].min.cjs',
path: path.resolve('./dist'),
},
}
2 changes: 1 addition & 1 deletion webpack.config.plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default {
library: '[name]',
libraryTarget: 'umd',
libraryExport: 'default',
filename: (entry) => `${entry.runtime.toLowerCase()}.min.js`,
filename: (entry) => `${entry.runtime.toLowerCase()}.min.cjs`,
path: path.resolve('./dist/plugins'),
},
}

0 comments on commit ffcdffc

Please sign in to comment.