Skip to content

Commit 21c80c8

Browse files
authoredJul 12, 2021
fix: reduce runtime when you use custom options (#520)
1 parent 8a26186 commit 21c80c8

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed
 

‎src/index.js

+9-6
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,15 @@ loaderAPI.pitch = function loader(request) {
3131
const { styleTagTransform } = options;
3232
const esModule =
3333
typeof options.esModule !== "undefined" ? options.esModule : true;
34-
const runtimeOptions = {
35-
injectType: options.injectType,
36-
attributes: options.attributes,
37-
insert: options.insert,
38-
base: options.base,
39-
};
34+
const runtimeOptions = {};
35+
36+
if (options.attributes) {
37+
runtimeOptions.attributes = options.attributes;
38+
}
39+
40+
if (options.base) {
41+
runtimeOptions.base = options.base;
42+
}
4043

4144
const insertFn = insertIsFunction
4245
? options.insert.toString()

0 commit comments

Comments
 (0)
Please sign in to comment.