-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0edee7b
commit 64f6b35
Showing
4 changed files
with
31 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,7 +129,7 @@ const showDiff = (filename, source, code, diffOption) => { | |
/** | ||
* [rollup-plugin-import-manager]{@link https://github.com/UmamiAppearance/rollup-plugin-import-manager} | ||
* | ||
* @version 0.3.7 | ||
* @version 0.4.0 | ||
* @author UmamiAppearance [[email protected]] | ||
* @license MIT | ||
*/ | ||
|
@@ -184,7 +184,7 @@ const importManager = (options={}) => { | |
|
||
const warnings = typeof options.warnings === "undefined" ? true : bool(options.warnings); | ||
|
||
const manager = new importManager$1.ImportManager(source, id, warnSpamProtection, warnings); | ||
const manager = new importManager$1.ImportManager(source, id, warnSpamProtection, warnings, this); | ||
|
||
if (!("units" in options) || "debug" in options) { | ||
if (showObjects(options.debug)) { | ||
|
@@ -319,7 +319,21 @@ const importManager = (options={}) => { | |
} | ||
|
||
else { | ||
const type = unitSection.type === "cjs" ? "cjs" : "es6"; | ||
// default is es6 | ||
let type = "es6"; | ||
|
||
// overwrite this if set by the config | ||
if (unitSection.type) { | ||
type = unitSection.type; | ||
} | ||
|
||
// if type is dynamic change to es6 if is6 imports | ||
// are found (as dynamic imports can be wildly spread) | ||
|
||
if (type === "dynamic" && manager.imports.es6.length) { | ||
type = "es6"; | ||
} | ||
|
||
manager.insertStatement(codeSnippet, unitSection.insert, type); | ||
} | ||
|
||
|
Oops, something went wrong.