Skip to content

Commit

Permalink
feat: add build-lib build-example command
Browse files Browse the repository at this point in the history
  • Loading branch information
deepkolos committed Dec 29, 2023
1 parent b71a819 commit 8ae39eb
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ lerna-debug.log*
node_modules
dist
dist-ssr
lib
*.local

# Editor directories and files
Expand Down
14 changes: 12 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
{
"name": "three-js-trail",
"private": true,
"version": "0.0.0",
"type": "module",
"author": "DeepKolos<[email protected]>",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"build-lib": "vite build -c vite.lib.ts",
"build-example": "vite build",
"preview": "vite preview"
},
"main": "./lib/Trail.umd.js",
"module": "./lib/Trail.js",
"exports": {
".": {
"import": "./lib/Trail.js",
"require": "./lib/Trail.umd.cjs"
}
},
"sideEffects": false,
"devDependencies": {
"@types/node": "^20.10.5",
"typescript": "^5.2.2",
"vite": "^5.0.8"
},
Expand Down
18 changes: 16 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions vite.config.ts → vite.lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ import { UserConfig } from 'vite';

export default {
build: {
outDir: 'lib',
lib: {
entry: 'src/index.ts',
name: 'Trail',
fileName: 'Trail',
},
copyPublicDir: false,
rollupOptions: {
// make sure to externalize deps that shouldn't be bundled
// into your library
Expand Down

0 comments on commit 8ae39eb

Please sign in to comment.