forked from Eagnir/GmailNotify-PubSub-GCP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
39 lines (37 loc) · 1.14 KB
/
rollup.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { defineConfig } from 'rollup';
import {version} from "./package.json";
import json from '@rollup/plugin-json';
import commonjs from '@rollup/plugin-commonjs';
import generatePackageJson from 'rollup-plugin-generate-package-json';
import clear from 'rollup-plugin-clear';
import copy from 'rollup-plugin-copy';
import execute from 'rollup-plugin-execute';
export default defineConfig ({
input: 'main.js',
output: {
file: 'publish/temp/index.js',
format: 'cjs',
exports:"named"
},
plugins: [
json(),
commonjs(),
generatePackageJson({
baseContents: (pkg) => ({
name: pkg.name,
version: pkg.version,
dependencies: {},
private: true
})
}),
clear({
targets: ['publish']
}),
copy({
targets: [
{ src: 'credentials/google-key.json', dest: 'publish/temp/credentials' }
]
}),
execute("cd publish/temp; sleep 0.1; zip -r ../GNFunc_v" + version.replace(".","-").replace(/\./g,"") + ".zip ./*; cd ..;sleep 0.1; rm -r ./temp")
]
});