Skip to content

Commit ec0747d

Browse files
committed
Add rollup
1 parent e03493f commit ec0747d

File tree

3 files changed

+47
-3
lines changed

3 files changed

+47
-3
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
node_modules
22
package-lock.json
3+
4+
index.js
5+
third-party-licenses.txt

package.json

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
{
22
"name": "tropy-plugin-iiif",
3+
"productName": "IIIF",
34
"version": "1.0.0",
4-
"description": "Tropy plugin to import IIIF manifests",
5+
"description": "Import IIIF manifests",
56
"icon": "icon.svg",
67
"main": "index.js",
78
"scripts": {
8-
"test": "electron-mocha test/**/*_test.js"
9+
"test": "electron-mocha --renderer test",
10+
"lint": "eslint --color src test",
11+
"build": "rollup -c rollup.config.js",
12+
"watch": "rollup -c -w rollup.config.js"
913
},
1014
"repository": {
1115
"type": "git",
@@ -43,8 +47,14 @@
4347
}
4448
],
4549
"devDependencies": {
46-
"electron": "^16.0.4",
50+
"@rollup/plugin-commonjs": "^22.0.0",
51+
"@rollup/plugin-json": "^4.1.0",
52+
"@rollup/plugin-node-resolve": "^13.3.0",
53+
"electron": "^18.2.2",
4754
"electron-mocha": "^11.0.2",
4855
"eslint": "^8.14.0",
56+
"jsonld": "^5.2.0",
57+
"rollup": "^2.72.1",
58+
"rollup-plugin-license": "^2.7.0"
4959
}
5060
}

rollup.config.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import commonjs from '@rollup/plugin-commonjs'
2+
import license from 'rollup-plugin-license'
3+
import resolve from '@rollup/plugin-node-resolve'
4+
import json from '@rollup/plugin-json'
5+
6+
export default {
7+
input: 'src/plugin.js',
8+
output: {
9+
file: 'index.js',
10+
format: 'cjs',
11+
exports: 'default',
12+
generatedCode: 'es2015'
13+
},
14+
external: ['electron'],
15+
plugins: [
16+
resolve({
17+
exportConditions: ['node'],
18+
preferBuiltins: true
19+
}),
20+
json(),
21+
commonjs(),
22+
license({
23+
thirdParty: {
24+
includePrivate: true,
25+
output: {
26+
file: 'third-party-licenses.txt'
27+
}
28+
}
29+
})
30+
]
31+
}

0 commit comments

Comments
 (0)