Skip to content

Commit fc5f239

Browse files
committed
fix(rollup): update rollup configuration
1 parent cf9a270 commit fc5f239

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
"name": "@jaebradley/example-rollup-react-component-npm-package",
33
"version": "0.0.0-development",
44
"description": "Example React Component for npm Publication using Rollup",
5-
"main": "./build/index.js",
6-
"module": "./build/index.es.js",
5+
"main": "build/index.cjs.js",
6+
"module": "build/index.esm.js",
7+
"browser": "build/index.umd.js",
78
"files": [
8-
"./build"
9+
"build"
910
],
1011
"scripts": {
1112
"build": "rollup -c",

rollup.config.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,15 @@ const config = {
1313
input: 'src/index.js',
1414
output: [
1515
{
16-
file: pkg.main,
16+
file: pkg.browser,
1717
format: 'umd',
1818
name: 'Example',
1919
},
20+
{
21+
file: pkg.main,
22+
format: 'cjs',
23+
name: 'Example',
24+
},
2025
{
2126
file: pkg.module,
2227
format: 'es',

0 commit comments

Comments
 (0)