2019-01-16 02:00:06 +03:00
|
|
|
/// <reference path=".typings/rollup-plugin-alias.d.ts" />
|
|
|
|
/// <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" />
|
|
|
|
|
2019-06-24 19:01:20 +03:00
|
|
|
import alias from "rollup-plugin-alias";
|
|
|
|
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";
|
2019-01-16 02:00:06 +03:00
|
|
|
|
2019-06-24 19:01:20 +03:00
|
|
|
const banner = `/** @license ms-rest-js
|
2019-01-16 02:00:06 +03:00
|
|
|
* 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}
|
|
|
|
*/
|
2019-06-24 19:01:20 +03:00
|
|
|
const nodeConfig = {
|
|
|
|
input: "./es/lib/msRest.js",
|
|
|
|
external: [
|
|
|
|
"form-data",
|
|
|
|
"http",
|
|
|
|
"https",
|
|
|
|
"node-fetch",
|
|
|
|
"os",
|
|
|
|
"stream",
|
|
|
|
"tough-cookie",
|
|
|
|
"tslib",
|
|
|
|
"tunnel",
|
|
|
|
"uuid/v4",
|
|
|
|
"xml2js",
|
|
|
|
],
|
|
|
|
output: {
|
|
|
|
file: "./dist/msRest.node.js",
|
|
|
|
format: "cjs",
|
|
|
|
sourcemap: true,
|
|
|
|
banner
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
nodeResolve({
|
|
|
|
module: true
|
|
|
|
}),
|
|
|
|
commonjs(),
|
|
|
|
sourcemaps(),
|
|
|
|
json(),
|
|
|
|
visualizer({
|
|
|
|
filename: "dist/node-stats.html",
|
|
|
|
sourcemap: true
|
|
|
|
})
|
|
|
|
]
|
|
|
|
};
|
2019-01-16 02:00:06 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @type {import('rollup').RollupFileOptions}
|
|
|
|
*/
|
2019-06-24 19:01:20 +03:00
|
|
|
const browserConfig = {
|
|
|
|
input: "./es/lib/msRest.js",
|
|
|
|
external: [],
|
|
|
|
output: {
|
|
|
|
file: "./dist/msRest.browser.js",
|
|
|
|
format: "umd",
|
|
|
|
name: "msRest",
|
|
|
|
sourcemap: true,
|
|
|
|
banner
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
alias({
|
|
|
|
"./defaultHttpClient": "./defaultHttpClient.browser",
|
|
|
|
"./policies/msRestUserAgentPolicy": "./policies/msRestUserAgentPolicy.browser",
|
|
|
|
"./policies/proxyPolicy": "./policies/proxyPolicy.browser",
|
|
|
|
"./util/xml": "./util/xml.browser",
|
|
|
|
"./util/base64": "./util/base64.browser",
|
|
|
|
}),
|
|
|
|
nodeResolve({
|
|
|
|
module: true,
|
|
|
|
browser: true
|
|
|
|
}),
|
|
|
|
commonjs(),
|
|
|
|
sourcemaps(),
|
|
|
|
visualizer({
|
|
|
|
filename: "dist/browser-stats.html",
|
|
|
|
sourcemap: true
|
|
|
|
})
|
|
|
|
]
|
|
|
|
};
|
2019-01-16 02:00:06 +03:00
|
|
|
|
2019-06-24 19:01:20 +03:00
|
|
|
export default [nodeConfig, browserConfig];
|