Skip to content

Commit

Permalink
chore(vite): use modern JS for path resolving (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
neoncitylights authored Jan 28, 2024
1 parent 97e78d6 commit 22e8af7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions libs/node-js-cjs-vite/vite.config.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { resolve } from 'node:path';

import { defineConfig } from 'vite';
import dts from 'vite-plugin-dts';

export default defineConfig({
build: {
lib: {
entry: resolve(__dirname, 'src/index.js'),
entry: new URL('src/index.js', import.meta.url).pathname,
formats: ['cjs'],
fileName: () => 'index.cjs',
},
Expand Down
4 changes: 1 addition & 3 deletions libs/node-ts-esm-vite/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { resolve } from 'node:path';

import { defineConfig } from 'vite';
import dts from 'vite-plugin-dts';

export default defineConfig({
build: {
lib: {
entry: resolve(__dirname, 'src/index.ts'),
entry: new URL('src/index.ts', import.meta.url).pathname,
formats: ['es'],
fileName: () => 'index.mjs',
},
Expand Down

0 comments on commit 22e8af7

Please sign in to comment.