Skip to content

Commit 16adaaf

Browse files
committed
🔧 Add Rollup
1 parent 2179cc7 commit 16adaaf

File tree

5 files changed

+103
-20
lines changed

5 files changed

+103
-20
lines changed

‎package-lock.json

+72-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
"name": "jira.js",
33
"version": "4.0.0",
44
"description": "A comprehensive JavaScript/TypeScript library designed for both Node.JS and browsers, facilitating seamless interaction with the Atlassian Jira API.",
5-
"main": "out/index.js",
5+
"main": "out/index.cjs",
66
"types": "out/index.d.ts",
7+
"module": "out/index.mjs",
78
"repository": "https://github.com/MrRefactoring/jira.js.git",
89
"author": "Vladislav Tupikin <[email protected]>",
910
"license": "MIT",
@@ -19,7 +20,7 @@
1920
"library"
2021
],
2122
"scripts": {
22-
"build": "tsc",
23+
"build": "rollup --config rollup.config.ts --configPlugin typescript",
2324
"prettier": "prettier --write src",
2425
"lint": "npm run lint:tests && npm run lint:examples && npm run lint:src:agile && npm run lint:src:clients && npm run lint:src:services && npm run lint:src:version2 && npm run lint:src:version3 && npm run lint:src:files",
2526
"lint:tests": "npm run lint:base -- tests",
@@ -53,6 +54,7 @@
5354
"code:formatting": "npm run replace:all && npm run prettier && npm run lint:fix"
5455
},
5556
"devDependencies": {
57+
"@rollup/plugin-typescript": "^11.1.6",
5658
"@swc-node/register": "^1.9.1",
5759
"@swc/helpers": "^0.5.11",
5860
"@types/node": "^18.19.33",
@@ -66,6 +68,7 @@
6668
"eslint-plugin-import": "^2.29.1",
6769
"prettier": "^3.2.5",
6870
"prettier-plugin-jsdoc": "^1.3.0",
71+
"rollup": "^4.18.0",
6972
"sinon": "^18.0.0",
7073
"ts-node": "^10.9.2",
7174
"typedoc": "^0.25.13",

‎rollup.config.ts

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/* eslint-disable import/no-extraneous-dependencies */
2+
import typescript from '@rollup/plugin-typescript';
3+
import { defineConfig } from 'rollup';
4+
5+
const config = defineConfig([
6+
{
7+
input: 'src/index.ts',
8+
output: [
9+
{
10+
file: './out/index.cjs',
11+
format: 'cjs',
12+
sourcemap: true,
13+
},
14+
{
15+
file: './out/index.mjs',
16+
format: 'es',
17+
sourcemap: true,
18+
},
19+
],
20+
plugins: [typescript()],
21+
},
22+
]);
23+
24+
export default config;

‎tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
"moduleResolution": "NodeNext",
77
"lib": ["ES2018", "DOM"],
88
"declaration": true,
9+
"declarationMap": true,
910
"importHelpers": true,
1011
"strict": true,
11-
"sourceMap": true,
1212
"verbatimModuleSyntax": true,
1313
"forceConsistentCasingInFileNames": true
1414
},

‎tsconfig.lint.json

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
{
22
"extends": "./tsconfig.json",
3-
"include": [
4-
"examples",
5-
"src",
6-
"tests"
7-
]
3+
"include": ["examples", "src", "tests", "rollup.config.ts"]
84
}

0 commit comments

Comments
 (0)