Skip to content
This repository has been archived by the owner on Nov 22, 2023. It is now read-only.

Commit

Permalink
chore: add aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
einaralex committed Nov 3, 2023
1 parent 0b17da5 commit b942832
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
21 changes: 19 additions & 2 deletions configs/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,31 @@
import path from 'path';
import { defineConfig } from 'vite';

const srcRoot = path.resolve(__dirname, '../src/');

export default defineConfig({
build: {
sourcemap: true,
lib: {
entry: path.resolve(__dirname, '../src/index.ts'),
entry: `${srcRoot}/index.ts`,
name: 'monerium-sdk',
// formats: ["es", "cjs", "umd", "iife"],
fileName: 'index',
},
},
resolve: {
alias: [
{
find: 'types',
replacement: `${srcRoot}/types.ts`,
},
{
find: 'utils',
replacement: `${srcRoot}/utils.ts`,
},
{
find: 'helpers',
replacement: `${srcRoot}/helpers/index.ts`,
},
],
},
});
6 changes: 6 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,11 @@ const config: Config = {
maxWorkers: 1,
coverageDirectory: '../static/coverage',
setupFiles: ['./configs/jest.setup.js'],
moduleNameMapper: {
'^utils$': '<rootDir>/src/utils',
'^types$': '<rootDir>/src/types',
'^helpers$': '<rootDir>/src/helpers',
// Add more aliases as needed
},
};
export default config;

0 comments on commit b942832

Please sign in to comment.