-
-
Notifications
You must be signed in to change notification settings - Fork 608
version 1.0 #742
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
version 1.0 #742
Changes from all commits
07444ad
50f8ec0
1b7acf7
965068d
b47c566
871e905
594a4c2
8f9ea06
1cb903b
9907f13
88c38e5
c5b2cc1
4fa385c
8db3fb0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,18 +6,14 @@ var loaderUtils = require("loader-utils"); | |
var processCss = require("./processCss"); | ||
var getImportPrefix = require("./getImportPrefix"); | ||
var compileExports = require("./compile-exports"); | ||
var createResolver = require("./createResolver"); | ||
|
||
|
||
module.exports = function(content, map) { | ||
if(this.cacheable) this.cacheable(); | ||
var callback = this.async(); | ||
var query = loaderUtils.getOptions(this) || {}; | ||
var root = query.root; | ||
var moduleMode = query.modules || query.module; | ||
var camelCaseKeys = query.camelCase || query.camelcase; | ||
var moduleMode = query.modules; | ||
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. because this is a refactor, shouldn't we use 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. @shellscape also let's do it other PR, when we ship webpack-default in this repo 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. OK |
||
var camelCaseKeys = query.camelCase; | ||
var sourceMap = query.sourceMap || false; | ||
var resolve = createResolver(query.alias); | ||
|
||
if(sourceMap) { | ||
if (map) { | ||
|
@@ -42,8 +38,6 @@ module.exports = function(content, map) { | |
from: loaderUtils.getRemainingRequest(this).split("!").pop(), | ||
to: loaderUtils.getCurrentRequest(this).split("!").pop(), | ||
query: query, | ||
resolve: resolve, | ||
minimize: this.minimize, | ||
loaderContext: this, | ||
sourceMap: sourceMap | ||
}, function(err, result) { | ||
|
@@ -63,7 +57,7 @@ module.exports = function(content, map) { | |
} | ||
return true; | ||
}).map(function(imp) { | ||
if(!loaderUtils.isUrlRequest(imp.url, root)) { | ||
if(!loaderUtils.isUrlRequest(imp.url)) { | ||
return "exports.push([module.id, " + | ||
JSON.stringify("@import url(" + imp.url + ");") + ", " + | ||
JSON.stringify(imp.mediaQuery) + "]);"; | ||
|
@@ -94,7 +88,7 @@ module.exports = function(content, map) { | |
var match = result.urlItemRegExp.exec(item); | ||
var idx = +match[1]; | ||
var urlItem = result.urlItems[idx]; | ||
var url = resolve(urlItem.url); | ||
var url = urlItem.url; | ||
idx = url.indexOf("?#"); | ||
if(idx < 0) idx = url.indexOf("#"); | ||
var urlRequest; | ||
|
@@ -108,7 +102,7 @@ module.exports = function(content, map) { | |
return "\" + escape(require(" + loaderUtils.stringifyRequest(this, urlRequest) + ")) + \""; | ||
}.bind(this)); | ||
} | ||
|
||
var exportJs = compileExports(result, importItemMatcher.bind(this), camelCaseKeys); | ||
if (exportJs) { | ||
exportJs = "exports.locals = " + exportJs + ";"; | ||
|
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.
can we ditch travis and get on circle CI?
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.
@shellscape let's do this in other PR
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.
OK