Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style-loader/useable: passing insertInto through options #327

Closed
mvoica opened this issue Jun 11, 2018 · 0 comments · Fixed by #341
Closed

style-loader/useable: passing insertInto through options #327

mvoica opened this issue Jun 11, 2018 · 0 comments · Fixed by #341

Comments

@mvoica
Copy link

mvoica commented Jun 11, 2018

a while ago, the option to have insertInto as a function instead of a string was added to the style-loader. And this is exactly what I needed - and it works great. Then I tried using this with /useable, and I noticed that in index.js we have this:

if (typeof options.insertInto === "function") {
insertInto = options.insertInto.toString();
}
...
"options.insertInto = " + insertInto + ";",
"var update = require(" + loaderUtils.stringifyRequest(this, "!" + path.join(__dirname, "lib", "addStyles.js")) + ")(content, options);",

which makes the correct body of the function be included in the bundle,

while in the useable we have this:
" dispose = require(" + loaderUtils.stringifyRequest(this, "!" + path.join(__dirname, "lib", "addStyles.js")) + ")(content, " + JSON.stringify(options) + ");",

which will omit the insertInto function.
Is there a particularity of the /useable that makes the usage with the insertInto (function) impossible?

@mvoica mvoica changed the title style-loader/useable style-loader/useable: passing insertInto through options Jun 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant