Fix the object to rollup-replace plugin (#8909)
The replacement should be in the argument object, instead of nested in `values` property
This commit is contained in:
Родитель
de7e78073f
Коммит
c8ec3009f9
|
@ -40,11 +40,9 @@ export function nodeConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}),
|
||||
nodeResolve({ preferBuiltins: true }),
|
||||
cjs()
|
||||
|
|
|
@ -24,11 +24,9 @@ export function nodeConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}),
|
||||
nodeResolve({ preferBuiltins: true, mainFields: ["module"] }),
|
||||
cjs()
|
||||
|
@ -81,12 +79,10 @@ export function browserConfig(test = false) {
|
|||
// ms-rest-js is externalized so users must include it prior to using this bundle.
|
||||
{
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}
|
||||
),
|
||||
nodeResolve({
|
||||
|
|
|
@ -50,11 +50,9 @@ export function nodeConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}),
|
||||
nodeResolve({ preferBuiltins: true }),
|
||||
cjs(),
|
||||
|
@ -99,12 +97,10 @@ export function browserConfig(test = false) {
|
|||
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}),
|
||||
|
||||
// dotenv doesn't work in the browser, so replace it with a no-op function
|
||||
|
|
|
@ -22,11 +22,9 @@ export function nodeConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}),
|
||||
nodeResolve({ preferBuiltins: true }),
|
||||
cjs()
|
||||
|
@ -69,12 +67,10 @@ export function browserConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}),
|
||||
nodeResolve({
|
||||
mainFields: ["module", "browser"],
|
||||
|
|
|
@ -24,11 +24,9 @@ export function nodeConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}),
|
||||
nodeResolve({ preferBuiltins: true }),
|
||||
cjs()
|
||||
|
@ -72,12 +70,10 @@ export function browserConfig(test = false, production = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}),
|
||||
nodeResolve({
|
||||
mainFields: ["module", "browser"],
|
||||
|
|
|
@ -24,11 +24,9 @@ export function nodeConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}),
|
||||
nodeResolve({ preferBuiltins: true }),
|
||||
cjs()
|
||||
|
@ -71,12 +69,10 @@ export function browserConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}),
|
||||
nodeResolve({
|
||||
mainFields: ["module", "browser"],
|
||||
|
|
|
@ -44,11 +44,9 @@ export function nodeConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}),
|
||||
nodeResolve({ preferBuiltins: true }),
|
||||
cjs()
|
||||
|
@ -97,12 +95,10 @@ export function browserConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}),
|
||||
// os is not used by the browser bundle, so just shim it
|
||||
shim({
|
||||
|
|
|
@ -22,11 +22,9 @@ export function nodeConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}),
|
||||
nodeResolve({ preferBuiltins: true }),
|
||||
cjs()
|
||||
|
@ -69,12 +67,10 @@ export function browserConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}),
|
||||
nodeResolve({
|
||||
mainFields: ["module", "browser"],
|
||||
|
|
|
@ -26,11 +26,9 @@ export function nodeConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}),
|
||||
nodeResolve({ preferBuiltins: true, mainFields: ["module"] }),
|
||||
cjs()
|
||||
|
@ -82,12 +80,10 @@ export function browserConfig(test = false) {
|
|||
// ms-rest-js is externalized so users must include it prior to using this bundle.
|
||||
{
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}
|
||||
),
|
||||
nodeResolve({
|
||||
|
|
|
@ -29,11 +29,9 @@ export function nodeConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}),
|
||||
nodeResolve({ preferBuiltins: true }),
|
||||
cjs(),
|
||||
|
@ -103,12 +101,10 @@ export function browserConfig(test = false) {
|
|||
// ms-rest-js is externalized so users must include it prior to using this bundle.
|
||||
{
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}
|
||||
),
|
||||
|
||||
|
|
|
@ -27,11 +27,9 @@ export function nodeConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}),
|
||||
nodeResolve({ preferBuiltins: true }),
|
||||
cjs(),
|
||||
|
@ -93,12 +91,10 @@ export function browserConfig(test = false) {
|
|||
// ms-rest-js is externalized so users must include it prior to using this bundle.
|
||||
{
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}
|
||||
),
|
||||
nodeResolve({
|
||||
|
|
|
@ -30,11 +30,9 @@ export function nodeConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}),
|
||||
nodeResolve({ preferBuiltins: true }),
|
||||
cjs(),
|
||||
|
@ -104,12 +102,10 @@ export function browserConfig(test = false) {
|
|||
// ms-rest-js is externalized so users must include it prior to using this bundle.
|
||||
{
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}
|
||||
),
|
||||
|
||||
|
|
|
@ -25,11 +25,9 @@ export function nodeConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}),
|
||||
nodeResolve({ preferBuiltins: true }),
|
||||
cjs()
|
||||
|
@ -74,12 +72,10 @@ export function browserConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}),
|
||||
shim({
|
||||
fs: `export default {}`,
|
||||
|
|
|
@ -22,11 +22,9 @@ export function nodeConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}),
|
||||
nodeResolve({ preferBuiltins: true }),
|
||||
cjs()
|
||||
|
@ -70,12 +68,10 @@ export function browserConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}),
|
||||
nodeResolve({
|
||||
mainFields: ["module", "browser"],
|
||||
|
|
|
@ -46,11 +46,9 @@ export function nodeConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}),
|
||||
nodeResolve({ preferBuiltins: true }),
|
||||
cjs()
|
||||
|
@ -104,12 +102,10 @@ export function browserConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}),
|
||||
// os is not used by the browser bundle, so just shim it
|
||||
shim({
|
||||
|
|
|
@ -46,11 +46,9 @@ export function nodeConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}),
|
||||
nodeResolve({ preferBuiltins: true }),
|
||||
cjs()
|
||||
|
@ -102,12 +100,10 @@ export function browserConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}),
|
||||
// os is not used by the browser bundle, so just shim it
|
||||
shim({
|
||||
|
|
|
@ -46,11 +46,9 @@ export function nodeConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}),
|
||||
nodeResolve({ preferBuiltins: true }),
|
||||
cjs()
|
||||
|
@ -102,12 +100,10 @@ export function browserConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}),
|
||||
// os is not used by the browser bundle, so just shim it
|
||||
shim({
|
||||
|
|
|
@ -25,11 +25,9 @@ export function nodeConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}),
|
||||
nodeResolve({ preferBuiltins: true }),
|
||||
cjs()
|
||||
|
@ -74,12 +72,10 @@ export function browserConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}),
|
||||
shim({
|
||||
constants: `export default {}`,
|
||||
|
|
|
@ -54,12 +54,10 @@ export function nodeConfig({ test = false, production = false } = {}) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)",
|
||||
"if (!isNode)": "if (false)"
|
||||
}
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)",
|
||||
"if (!isNode)": "if (false)"
|
||||
}),
|
||||
nodeResolve({ preferBuiltins: true }),
|
||||
cjs(),
|
||||
|
@ -114,13 +112,11 @@ export function browserConfig(test = false) {
|
|||
// ms-rest-js is externalized so users must include it prior to using this bundle.
|
||||
{
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)",
|
||||
"if (!isNode)": "if (true)"
|
||||
}
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)",
|
||||
"if (!isNode)": "if (true)"
|
||||
}
|
||||
),
|
||||
// fs, net, and tls are used by rhea and need to be shimmed
|
||||
|
|
|
@ -45,11 +45,10 @@ export function nodeConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)",
|
||||
"if (!isNode)": "if (false)"
|
||||
}),
|
||||
nodeResolve({ preferBuiltins: true }),
|
||||
cjs()
|
||||
|
@ -105,12 +104,11 @@ export function browserConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)",
|
||||
"if (!isNode)": "if (true)"
|
||||
}),
|
||||
// fs and os are not used by the browser bundle, so just shim it
|
||||
// dotenv doesn't work in the browser, so replace it with a no-op function
|
||||
|
|
|
@ -45,11 +45,9 @@ export function nodeConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}),
|
||||
nodeResolve({ preferBuiltins: true }),
|
||||
cjs({
|
||||
|
@ -120,12 +118,10 @@ export function browserConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}),
|
||||
// fs and os are not used by the browser bundle, so just shim it
|
||||
// dotenv doesn't work in the browser, so replace it with a no-op function
|
||||
|
|
|
@ -45,11 +45,9 @@ export function nodeConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}),
|
||||
nodeResolve({ preferBuiltins: true }),
|
||||
cjs()
|
||||
|
@ -105,12 +103,10 @@ export function browserConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}),
|
||||
// fs and os are not used by the browser bundle, so just shim it
|
||||
// dotenv doesn't work in the browser, so replace it with a no-op function
|
||||
|
|
|
@ -37,11 +37,9 @@ export function nodeConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}),
|
||||
nodeResolve({ preferBuiltins: true }),
|
||||
cjs()
|
||||
|
@ -97,12 +95,10 @@ export function browserConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}),
|
||||
// os is not used by the browser bundle, so just shim it
|
||||
shim({
|
||||
|
|
|
@ -22,11 +22,9 @@ export function nodeConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}),
|
||||
nodeResolve({ preferBuiltins: true }),
|
||||
cjs()
|
||||
|
@ -70,12 +68,10 @@ export function browserConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}),
|
||||
nodeResolve({
|
||||
mainFields: ["module", "browser"],
|
||||
|
|
|
@ -22,11 +22,9 @@ export function nodeConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}),
|
||||
nodeResolve({ preferBuiltins: true }),
|
||||
cjs()
|
||||
|
@ -67,12 +65,10 @@ export function browserConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}),
|
||||
nodeResolve({
|
||||
mainFields: ["module", "browser"],
|
||||
|
|
|
@ -25,11 +25,9 @@ export function nodeConfig(test = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}
|
||||
// replace dynamic checks with if (true) since this is for node only.
|
||||
// Allows rollup's dead code elimination to be more aggressive.
|
||||
"if (isNode)": "if (true)"
|
||||
}),
|
||||
nodeResolve({ preferBuiltins: true }),
|
||||
cjs()
|
||||
|
@ -74,12 +72,10 @@ export function browserConfig(test = false, production = false) {
|
|||
sourcemaps(),
|
||||
replace({
|
||||
delimiters: ["", ""],
|
||||
values: {
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}
|
||||
// replace dynamic checks with if (false) since this is for
|
||||
// browser only. Rollup's dead code elimination will remove
|
||||
// any code guarded by if (isNode) { ... }
|
||||
"if (isNode)": "if (false)"
|
||||
}),
|
||||
shim({
|
||||
constants: `export default {}`,
|
||||
|
|
Загрузка…
Ссылка в новой задаче