forked from microsoftgraph/msgraph-sdk-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
102 lines (98 loc) · 2.49 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/**
* -------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License.
* See License in the project root for license information.
* -------------------------------------------------------------------------------------------
*/
import { terser } from "rollup-plugin-terser";
import resolve from "@rollup/plugin-node-resolve";
import babel from "@rollup/plugin-babel";
import commonjs from "@rollup/plugin-commonjs";
const copyRight = `/**
* -------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License.
* See License in the project root for license information.
* -------------------------------------------------------------------------------------------
*/`;
const config = [
{
input: ["lib/es/src/browser/index.js"],
output: {
file: "lib/graph-js-sdk.js",
format: "iife",
name: "MicrosoftGraph",
},
plugins: [
resolve({
browser: true,
preferBuiltins: false,
}),
babel({
babelHelpers: "runtime",
exclude: "node_modules/**",
}),
commonjs({ include: "node_modules/**" }),
terser({
format: {
comments: false,
preamble: copyRight,
},
}),
],
},
{
input: ["authProviders/es/azureTokenCredentials/index.js"],
output: {
file: "lib/graph-client-tokenCredentialAuthProvider.js",
format: "iife",
name: "MicrosoftGraphTokenCredentialAuthProvider",
},
plugins: [
resolve({
browser: true,
preferBuiltins: false,
}),
babel({
babelHelpers: "runtime",
exclude: "node_modules/**",
}),
commonjs({ include: "node_modules/**" }),
terser({
format: {
comments: false,
preamble: copyRight,
},
}),
],
},
{
input: ["lib/es/src/authentication/msal-browser/AuthCodeMSALBrowserAuthenticationProvider.js"],
external: ["@azure/msal-browser"],
output: {
file: "lib/graph-client-msalBrowserAuthProvider.js",
format: "iife",
name: "MSGraphAuthCodeMSALBrowserAuthProvider",
globals: {
"@azure/msal-browser": "msal",
},
},
plugins: [
resolve({
browser: true,
preferBuiltins: false,
}),
babel({
babelHelpers: "runtime",
exclude: "node_modules/**",
}),
commonjs({ include: "node_modules/**" }),
terser({
format: {
comments: false,
preamble: copyRight,
},
}),
],
},
];
export default config;