Skip to content

Commit 94921d1

Browse files
committed
Generate cjs build
1 parent 2cb9221 commit 94921d1

6 files changed

Lines changed: 51 additions & 11 deletions

File tree

.npmignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
demo/
1+
demo/
2+
src/
3+
playground/

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
## v0.1.5
2+
3+
- Generate cjs build using vitejs
4+
- Fix styling issues in navigation button
5+
- Move React to peer dependency
6+
7+
## v0.1.2
8+
9+
Publish package

package.json

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
{
22
"name": "react-card-stack-carousel",
3-
"version": "0.1.1",
3+
"version": "0.1.5",
44
"description": "A tiny configurable carousel component for React",
5-
"main": "index.js",
5+
"main": "dist/index.js",
66
"scripts": {
7-
"dev": "vite ./playground"
7+
"dev": "vite ./playground",
8+
"build": "vite build",
9+
"prepublish": "yarn build"
810
},
911
"repository": {
1012
"url": "https://github.com/shettypuneeth/react-card-stack-carousel",
@@ -17,16 +19,16 @@
1719
"card stack"
1820
],
1921
"include": [
20-
"src/**/*",
2122
"styles/**/*",
22-
"types/**/*"
23+
"types/**/*",
24+
"dist/**/*"
2325
],
2426
"types": "types/index.d.ts",
2527
"author": "Puneeth Shetty",
2628
"license": "MIT",
27-
"dependencies": {
28-
"react": "*",
29-
"react-dom": "*"
29+
"peerDependencies": {
30+
"react": ">16",
31+
"react-dom": ">16"
3032
},
3133
"devDependencies": {
3234
"@vitejs/plugin-react": "^4.2.1",

playground/styles.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
body * {
2+
box-sizing: border-box;
3+
}
4+
15
body {
26
background-color: #0f172a;
37
width: 100vw;

styles/styles.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
display: flex;
2323
justify-content: center;
2424
align-items: center;
25-
width: 15px;
26-
height: 15px;
25+
width: 30px;
26+
height: 30px;
2727
border-radius: 50%;
2828
margin: 0 5px;
2929
padding: 8px;

vite.config.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// generate vite config for react component prod build
2+
import { defineConfig } from "vite";
3+
import react from "@vitejs/plugin-react";
4+
5+
export default defineConfig({
6+
plugins: [react()],
7+
build: {
8+
lib: {
9+
entry: "./index.js",
10+
name: "react-card-stack-carousel",
11+
fileName: "index",
12+
formats: ["cjs"],
13+
},
14+
rollupOptions: {
15+
external: ["react"],
16+
output: {
17+
globals: {
18+
react: "React",
19+
},
20+
},
21+
},
22+
},
23+
});

0 commit comments

Comments
 (0)