diff --git a/index.js b/index.js index a59e712..54d73c0 100644 --- a/index.js +++ b/index.js @@ -1,9 +1,13 @@ /* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra */ -module.exports = function(content) { - this.cacheable && this.cacheable(); - this.value = content; - return "module.exports = " + JSON.stringify(content); +module.exports = function(source) { + this.value = source; + + var json = JSON.stringify(source) + .replace(/\u2028/g, '\\u2028') + .replace(/\u2029/g, '\\u2029'); + + return "module.exports = " + json; }