Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,15 +250,15 @@ When using a build tool like WebPack, Babel, Rollup or the TypeScript compiler:

```javascript
// Import the Web-eID library
import * as webeid from '@web-eid/web-eid-library/web-eid';
import * as webeid from '@web-eid/web-eid-library';

// ...or only what you need
import {
status,
authenticate,
Action,
ErrorCode
} from '@web-eid/web-eid-library/web-eid';
} from '@web-eid/web-eid-library';


// If you need TypeScript interfaces, they are also available!
Expand Down Expand Up @@ -914,12 +914,6 @@ npm link ~/workspace/web-eid-library
- This option might be more convenient for active development.
- After making changes to the Web-eID library source and rebuilding the library project, you don't need to reinstall the dependency in your other project.

**Cons**
- ES modules are located at `web-eid/dist/node/` instead of directly under `web-eid/`.
```ts
import AuthenticateOptions from 'web-eid/dist/node/models/AuthenticateOptions';
```

#### Using `npm pack`

You can use `npm pack` to generate a package and install the package archive.
Expand Down
51 changes: 45 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,51 @@
"type": "git",
"url": "git@github.com:web-eid/web-eid.js.git"
},
"module": "web-eid.js",
"type": "module",
"main": "dist/umd/web-eid.cjs",
"module": "dist/node/web-eid.js",
"types": "dist/node/web-eid.d.ts",
"exports": {
".": {
"types": "./dist/node/web-eid.d.ts",
"import": "./dist/node/web-eid.js",
"require": "./dist/umd/web-eid.cjs",
"default": "./dist/umd/web-eid.cjs"
},
"./config": {
"types": "./dist/node/config.d.ts",
"import": "./dist/node/config.js"
},
"./errors/*": {
"types": "./dist/node/errors/*.d.ts",
"import": "./dist/node/errors/*.js"
},
"./models/*": {
"types": "./dist/node/models/*.d.ts",
"import": "./dist/node/models/*.js"
},
"./models/message/*": {
"types": "./dist/node/models/message/*.d.ts",
"import": "./dist/node/models/message/*.js"
},
"./services/*": {
"types": "./dist/node/services/*.d.ts",
"import": "./dist/node/services/*.js"
},
"./utils/*": {
"types": "./dist/node/utils/*.d.ts",
"import": "./dist/node/utils/*.js"
},
"./dist/es/*": "./dist/es/*",
"./dist/iife/*": "./dist/iife/*",
"./dist/umd/*": "./dist/umd/*"
},
"files": [
"src/**/*",
"dist/node/**/*",
"dist/es/*",
"dist/iife/*",
"dist/umd/*",
"config.d.ts",
"config.d.ts.map",
"config.js",
Expand All @@ -30,12 +73,8 @@
"errors/**/*",
"models/**/*",
"services/**/*",
"utils/**/*",
"dist/es/*",
"dist/iife/*",
"dist/umd/*"
"utils/**/*"
],
"types": "web-eid.d.ts",
"author": "Tanel Metsar",
"license": "MIT",
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ export default {
plugins: [terser()],
},
{
file: "dist/umd/web-eid.js",
file: "dist/umd/web-eid.cjs",
format: "umd",
name: "webeid",
sourcemap: true,
},
{
file: "dist/umd/web-eid.min.js",
file: "dist/umd/web-eid.min.cjs",
format: "umd",
name: "webeid",
sourcemap: false,
Expand Down