@azure/arm-healthcareapis 2.2.1-alpha.20231002.1 → 2.2.1-alpha.20231016.1

Sign up to get free protection for your applications and to get access to all the features.
package/rollup.config.js DELETED
@@ -1,122 +0,0 @@
1
- /*
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- *
5
- * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
- */
8
-
9
- import nodeResolve from "@rollup/plugin-node-resolve";
10
- import cjs from "@rollup/plugin-commonjs";
11
- import sourcemaps from "rollup-plugin-sourcemaps";
12
- import multiEntry from "@rollup/plugin-multi-entry";
13
- import json from "@rollup/plugin-json";
14
-
15
- import nodeBuiltins from "builtin-modules";
16
-
17
- // #region Warning Handler
18
-
19
- /**
20
- * A function that can determine whether a rollup warning should be ignored. If
21
- * the function returns `true`, then the warning will not be displayed.
22
- */
23
-
24
- function ignoreNiseSinonEval(warning) {
25
- return (
26
- warning.code === "EVAL" &&
27
- warning.id &&
28
- (warning.id.includes("node_modules/nise") ||
29
- warning.id.includes("node_modules/sinon")) === true
30
- );
31
- }
32
-
33
- function ignoreChaiCircularDependency(warning) {
34
- return (
35
- warning.code === "CIRCULAR_DEPENDENCY" &&
36
- warning.importer && warning.importer.includes("node_modules/chai") === true
37
- );
38
- }
39
-
40
- const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval];
41
-
42
- /**
43
- * Construct a warning handler for the shared rollup configuration
44
- * that ignores certain warnings that are not relevant to testing.
45
- */
46
- function makeOnWarnForTesting() {
47
- return (warning, warn) => {
48
- // If every inhibitor returns false (i.e. no inhibitors), then show the warning
49
- if (warningInhibitors.every((inhib) => !inhib(warning))) {
50
- warn(warning);
51
- }
52
- };
53
- }
54
-
55
- // #endregion
56
-
57
- function makeBrowserTestConfig() {
58
- const config = {
59
- input: {
60
- include: ["dist-esm/test/**/*.spec.js"],
61
- exclude: ["dist-esm/test/**/node/**"]
62
- },
63
- output: {
64
- file: `dist-test/index.browser.js`,
65
- format: "umd",
66
- sourcemap: true
67
- },
68
- preserveSymlinks: false,
69
- plugins: [
70
- multiEntry({ exports: false }),
71
- nodeResolve({
72
- mainFields: ["module", "browser"]
73
- }),
74
- cjs(),
75
- json(),
76
- sourcemaps()
77
- //viz({ filename: "dist-test/browser-stats.html", sourcemap: true })
78
- ],
79
- onwarn: makeOnWarnForTesting(),
80
- // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0,
81
- // rollup started respecting the "sideEffects" field in package.json. Since
82
- // our package.json sets "sideEffects=false", this also applies to test
83
- // code, which causes all tests to be removed by tree-shaking.
84
- treeshake: false
85
- };
86
-
87
- return config;
88
- }
89
-
90
- const defaultConfigurationOptions = {
91
- disableBrowserBundle: false
92
- };
93
-
94
- export function makeConfig(pkg, options) {
95
- options = {
96
- ...defaultConfigurationOptions,
97
- ...(options || {})
98
- };
99
-
100
- const baseConfig = {
101
- // Use the package's module field if it has one
102
- input: pkg["module"] || "dist-esm/src/index.js",
103
- external: [
104
- ...nodeBuiltins,
105
- ...Object.keys(pkg.dependencies),
106
- ...Object.keys(pkg.devDependencies)
107
- ],
108
- output: { file: "dist/index.js", format: "cjs", sourcemap: true },
109
- preserveSymlinks: false,
110
- plugins: [sourcemaps(), nodeResolve()]
111
- };
112
-
113
- const config = [baseConfig];
114
-
115
- if (!options.disableBrowserBundle) {
116
- config.push(makeBrowserTestConfig());
117
- }
118
-
119
- return config;
120
- }
121
-
122
- export default makeConfig(require("./package.json"));