-
Notifications
You must be signed in to change notification settings - Fork 55
/
rollup.config.ts
82 lines (77 loc) · 1.87 KB
/
rollup.config.ts
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
/// <reference path=".typings/rollup-plugin-commonjs.d.ts" />
/// <reference path=".typings/rollup-plugin-json.d.ts" />
/// <reference path=".typings/rollup-plugin-node-resolve.d.ts" />
/// <reference path=".typings/rollup-plugin-sourcemaps.d.ts" />
/// <reference path=".typings/rollup-plugin-visualizer.d.ts" />
import commonjs from "rollup-plugin-commonjs";
import json from "rollup-plugin-json";
import nodeResolve from "rollup-plugin-node-resolve";
import sourcemaps from "rollup-plugin-sourcemaps";
import visualizer from "rollup-plugin-visualizer";
const banner = `/** @license ms-rest-js
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt and ThirdPartyNotices.txt in the project root for license information.
*/`;
/**
* @type {import('rollup').RollupFileOptions}
*/
const nodeConfig = {
input: "./es/lib/msRest.js",
external: [
"form-data",
"http",
"https",
"node-fetch",
"os",
"stream",
"tough-cookie",
"tslib",
"tunnel",
"uuid",
"xml2js",
],
output: {
file: "./dist/msRest.node.js",
format: "cjs",
sourcemap: true,
banner,
},
plugins: [
nodeResolve({
mainFields: ["module", "main"],
}),
commonjs(),
sourcemaps(),
json(),
visualizer({
filename: "dist/node-stats.html",
sourcemap: true,
}),
],
};
/**
* @type {import('rollup').RollupFileOptions}
*/
const browserConfig = {
input: "./es/lib/msRest.js",
external: [],
output: {
file: "./dist/msRest.browser.js",
format: "umd",
name: "msRest",
sourcemap: true,
banner,
},
plugins: [
nodeResolve({
mainFields: ["module", "main", "browser"],
}),
commonjs(),
sourcemaps(),
visualizer({
filename: "dist/browser-stats.html",
sourcemap: true,
}),
],
};
export default [nodeConfig, browserConfig];