-
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.
Merge pull request #32 from UmamiAppearance/v0.4.0
V0.4.0
- Loading branch information
Showing
7 changed files
with
254 additions
and
117 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); | ||
} | ||
|
||
|
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/** | ||
* [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 | ||
*/ | ||
|
@@ -61,7 +61,7 @@ const importManager = (options={}) => { | |
|
||
const warnings = typeof options.warnings === "undefined" ? true : bool(options.warnings); | ||
|
||
const manager = new ImportManager(source, id, warnSpamProtection, warnings); | ||
const manager = new ImportManager(source, id, warnSpamProtection, warnings, this); | ||
|
||
if (!("units" in options) || "debug" in options) { | ||
if (showObjects(options.debug)) { | ||
|
@@ -196,7 +196,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); | ||
} | ||
|
||
|
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