Skip to content

Commit

Permalink
fix: reduce runtime when you use custom options (#520)
Browse files Browse the repository at this point in the history
  • Loading branch information
cap-Bernardito committed Jul 12, 2021
1 parent 8a26186 commit 21c80c8
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/index.js
Expand Up @@ -31,12 +31,15 @@ loaderAPI.pitch = function loader(request) {
const { styleTagTransform } = options;
const esModule =
typeof options.esModule !== "undefined" ? options.esModule : true;
const runtimeOptions = {
injectType: options.injectType,
attributes: options.attributes,
insert: options.insert,
base: options.base,
};
const runtimeOptions = {};

if (options.attributes) {
runtimeOptions.attributes = options.attributes;
}

if (options.base) {
runtimeOptions.base = options.base;
}

const insertFn = insertIsFunction
? options.insert.toString()
Expand Down

0 comments on commit 21c80c8

Please sign in to comment.