-
-
Notifications
You must be signed in to change notification settings - Fork 469
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
Full local export / server side rendering #159
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,9 +21,7 @@ var stylesInDom = {}, | |
styleElementsInsertedAtTop = []; | ||
|
||
module.exports = function(list, options) { | ||
if(typeof DEBUG !== "undefined" && DEBUG) { | ||
if(typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment"); | ||
} | ||
if(typeof document !== "object") return; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure this should be removed, we currently don't intend to let this loader work outside of browser context, there is discussion about it going please join that 😛 cc @ekulabuhov @bebraw @d3viant0ne There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, better leave. It should be documented visibly that you are meant to use style-loader in browser environment only. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Scratch my comment. I can see the point now. Basically we have to wait for a decision before we can move on the PR. |
||
options = options || {}; | ||
// Force single-tag solution on IE6-9, which has a hard limit on the # of <style> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,9 +14,10 @@ module.exports.pitch = function(remainingRequest) { | |
"// load the styles", | ||
"var content = require(" + loaderUtils.stringifyRequest(this, "!!" + remainingRequest) + ");", | ||
"if(typeof content === 'string') content = [[module.id, content, '']];", | ||
"if(content.locals && " + query.fullLocalExport + ") module.exports = content;", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
"else if (content.locals) module.exports = content.locals;", | ||
"// add the styles to the DOM", | ||
"var update = require(" + loaderUtils.stringifyRequest(this, "!" + path.join(__dirname, "addStyles.js")) + ")(content, " + JSON.stringify(query) + ");", | ||
"if(content.locals) module.exports = content.locals;", | ||
"// Hot Module Replacement", | ||
"if(module.hot) {", | ||
" // When the styles change, update the <style> tags", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "style-loader", | ||
"version": "0.13.1", | ||
"version": "0.14.0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please don't 😛 . |
||
"author": "Tobias Koppers @sokra", | ||
"description": "style loader module for webpack", | ||
"devDependencies": { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fullLocalExport
=>export/locals/exportLocals