File tree Expand file tree Collapse file tree 4 files changed +31
-3
lines changed
Expand file tree Collapse file tree 4 files changed +31
-3
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @stackoverflow/stacks-utils " : patch
3+ ---
4+
5+ ensure correct module resolution in nodejs
Original file line number Diff line number Diff line change 1616 " !dist/**/*.test.*"
1717 ],
1818 "scripts" : {
19- "build" : " tsc" ,
19+ "build" : " vite build && tsc --emitDeclarationOnly " ,
2020 "test" : " vitest run" ,
2121 "test:watch" : " vitest watch" ,
2222 "format" : " prettier --write ." ,
Original file line number Diff line number Diff line change 11import dayjs from "dayjs" ;
2- import relativeTime from "dayjs/plugin/relativeTime" ;
3- import updateLocale from "dayjs/plugin/updateLocale" ;
2+ import relativeTime from "dayjs/plugin/relativeTime.js " ;
3+ import updateLocale from "dayjs/plugin/updateLocale.js " ;
44
55dayjs . extend ( relativeTime ) ;
66dayjs . extend ( updateLocale ) ;
Original file line number Diff line number Diff line change 1+ import { defineConfig } from "vite" ;
2+ import pkg from "./package.json" with { type : "json" } ;
3+
4+ const external = Object . keys ( pkg . dependencies ?? { } ) ;
5+
6+ export default defineConfig ( {
7+ build : {
8+ lib : {
9+ entry : "./src/index.ts" ,
10+ formats : [ "es" ] ,
11+ } ,
12+ minify : false ,
13+ rollupOptions : {
14+ external : ( id ) =>
15+ external . some ( ( dep ) => id === dep || id . startsWith ( `${ dep } /` ) ) ,
16+ output : {
17+ preserveModules : true ,
18+ preserveModulesRoot : "src" ,
19+ entryFileNames : "[name].js" ,
20+ } ,
21+ } ,
22+ } ,
23+ } ) ;
You can’t perform that action at this time.
0 commit comments