-
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.
* added prebuild to occur during rollup process; fixed prod build to use new bundled modules * rollup file cleanup * fixed env bug * Update examples/rollup.config.js * jsdoc fixes and line wrapping * Update examples/utils.mjs Co-authored-by: Will Eastcott <[email protected]> --------- Co-authored-by: Will Eastcott <[email protected]>
- Loading branch information
1 parent
d75dba5
commit 8202ad8
Showing
5 changed files
with
101 additions
and
101 deletions.
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
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
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,21 @@ | ||
const regexPatterns = [ | ||
/^\s*export\s*\*\s*from\s*.+\s*;\s*$/gm, | ||
/^\s*export\s*{.*}\s*from\s*.+\s*;\s*$/gm, | ||
/^\s*import\s*.+\s*;\s*$/gm, | ||
]; | ||
|
||
/** | ||
* Checks if the provided content matches any of a set of patterns indicative of an ES Module with external dependencies. | ||
* Patterns checked include certain export and import statement formats. | ||
* | ||
* @param {string} content The file content to test. | ||
* @returns {boolean} Whether the content is likely an ES Module with external dependencies. | ||
* @example | ||
* isModuleWithExternalDependencies(` | ||
* // Testing variants: | ||
* export * from './index.mjs'; | ||
* export { Ray } from './core/shape/ray.js'; | ||
* import './polyfill/OESVertexArrayObject.js'; | ||
* `); | ||
*/ | ||
export const isModuleWithExternalDependencies = (content) => regexPatterns.some(pattern => pattern.test(content)); |