Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: require from module's root returns an empty object. #20

Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
},
"license": "Apache-2.0",
"author": "StarkWare Industries Ltd.",
"main": "dist/index.js",
"types": "dist/types/src/js/index.d.ts",
"main": "dist/index.cjs.js",
"module": "dist/index.es.js",
"types": "dist/types/index.d.ts",
"files": [
"dist",
"src/config",
Expand All @@ -32,7 +33,7 @@
],
"scripts": {
"prebuild": "npm run clean",
"build": "webpack --mode production",
"build": "vite build",
"clean": "rm -rf ./dist",
"dev": "webpack-dev-server --mode development",
"docs:generate": "typedoc",
Expand Down Expand Up @@ -82,13 +83,11 @@
"mocha": "^10.2.0",
"prettier": "^2.8.7",
"semantic-release": "^19.0.5",
"terser-webpack-plugin": "^5.3.9",
"ts-loader": "^9.4.4",
"ts-node": "^10.9.1",
"typedoc": "^0.23.16",
"typescript": "^4.8.4",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1"
"vite": "^4.5.0",
"vite-plugin-dts": "^3.6.3"
}
}
26 changes: 26 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { defineConfig } from 'vite';

Check failure on line 1 in vite.config.ts

View workflow job for this annotation

GitHub Actions / Find linting problems in your JavaScript

Replace `·defineConfig·` with `defineConfig`
import dts from 'vite-plugin-dts';

export default defineConfig({
plugins: [
dts({
insertTypesEntry: true,
outDir: 'dist/types'
})
],
build: {
lib: {
entry: 'src/js/index.ts',
name: '@starkware-industries/starkware-crypto-utils',
fileName: (format) => `index.${format}.js`,

Check failure on line 15 in vite.config.ts

View workflow job for this annotation

GitHub Actions / Find linting problems in your JavaScript

Replace `(format)` with `format`
formats: ['cjs', 'es']
},
rollupOptions: {
external: [],
output: {
exports: 'named',
dir: 'dist',

Check failure on line 22 in vite.config.ts

View workflow job for this annotation

GitHub Actions / Find linting problems in your JavaScript

Delete `,`
},

Check failure on line 23 in vite.config.ts

View workflow job for this annotation

GitHub Actions / Find linting problems in your JavaScript

Delete `,`
},

Check failure on line 24 in vite.config.ts

View workflow job for this annotation

GitHub Actions / Find linting problems in your JavaScript

Delete `,`
},

Check failure on line 25 in vite.config.ts

View workflow job for this annotation

GitHub Actions / Find linting problems in your JavaScript

Delete `,`
});
40 changes: 0 additions & 40 deletions webpack.config.js

This file was deleted.