-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix missing variables for UMD and IIFE builds (#3724)
- Loading branch information
1 parent
13f18ef
commit 42d2dfa
Showing
7 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module.exports = { | ||
description: 'handles empty imports when generating IIFE output', | ||
expectedWarnings: ['MISSING_NODE_BUILTINS', 'UNRESOLVED_IMPORT'], | ||
options: { | ||
output: { | ||
format: 'iife', | ||
globals: { | ||
dns: 'dns', | ||
util: 'util', | ||
fs: 'fs' | ||
} | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
(function (dns, util, fs) { | ||
'use strict'; | ||
|
||
dns.resolve('name'); | ||
fs.writeFileSync('foo', 'bar'); | ||
|
||
}(dns, util, fs)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { resolve } from 'dns'; | ||
import 'util'; | ||
import { writeFileSync } from 'fs'; | ||
|
||
resolve('name'); | ||
writeFileSync('foo', 'bar'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module.exports = { | ||
description: 'handles empty imports when generating IIFE output', | ||
expectedWarnings: ['MISSING_NODE_BUILTINS', 'UNRESOLVED_IMPORT'], | ||
options: { | ||
output: { | ||
format: 'umd', | ||
globals: { | ||
dns: 'dns', | ||
util: 'util', | ||
fs: 'fs' | ||
} | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('dns'), require('util'), require('fs')) : | ||
typeof define === 'function' && define.amd ? define(['dns', 'util', 'fs'], factory) : | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.dns, global.util, global.fs)); | ||
}(this, (function (dns, util, fs) { 'use strict'; | ||
|
||
dns.resolve('name'); | ||
fs.writeFileSync('foo', 'bar'); | ||
|
||
}))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { resolve } from 'dns'; | ||
import 'util'; | ||
import { writeFileSync } from 'fs'; | ||
|
||
resolve('name'); | ||
writeFileSync('foo', 'bar'); |