Skip to content

Commit 6d1d9af

Browse files
committed
feat(app): Fix merge conflict
2 parents c2a25e8 + d351f03 commit 6d1d9af

6 files changed

Lines changed: 39 additions & 1 deletion

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
/benchmark/fixtures
66
/examples/*/js
77
/coverage
8-
.DS_Store
8+
.DS_Store
9+
*.log

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ Please see [Using Loaders](http://webpack.github.io/docs/using-loaders.html) for
9797
**styling**
9898
* [`style`](https://github.com/webpack/style-loader): Add exports of a module as style to DOM
9999
* [`css`](https://github.com/webpack/css-loader): Loads css file with resolved imports and returns css code
100+
* [`cssnext`](https://github.com/cssnext/cssnext-loader): Loads and compiles a css file using [cssnext](http://cssnext.io/)
100101
* [`less`](https://github.com/webpack/less-loader): Loads and compiles a less file
101102
* [`sass`](https://github.com/jtangelder/sass-loader): Loads and compiles a scss file
102103
* [`stylus`](https://github.com/shama/stylus-loader): Loads and compiles a stylus file

lib/ModuleFilenameHelpers.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,19 @@ ModuleFilenameHelpers.createFilename = function createFilename(module, moduleFil
6666
var allLoaders = getBefore(identifier, "!");
6767
var query = getAfter(resource, "?");
6868
var resourcePath = resource.substr(0, resource.length - query.length);
69+
if(typeof moduleFilenameTemplate === "function") {
70+
return moduleFilenameTemplate({
71+
identifier: identifier,
72+
shortIdentifier: shortIdentifier,
73+
resource: resource,
74+
resourcePath: resourcePath,
75+
absoluteResourcePath: absoluteResourcePath,
76+
allLoaders: allLoaders,
77+
query: query,
78+
moduleId: moduleId,
79+
hash: hash
80+
});
81+
}
6982
return (moduleFilenameTemplate
7083
.replace(ModuleFilenameHelpers.REGEXP_ALL_LOADERS_RESOURCE, identifier)
7184
.replace(ModuleFilenameHelpers.REGEXP_LOADERS_RESOURCE, shortIdentifier)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
it("should include test.js in SourceMap", function() {
2+
var fs = require("fs");
3+
var source = fs.readFileSync(__filename + ".map", "utf-8");
4+
var map = JSON.parse(source);
5+
map.sources.should.containEql("dummy:///./test.js");
6+
});
7+
8+
require.include("./test.js");
9+

test/configCases/filename-template/module-filename-template/test.js

Whitespace-only changes.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module.exports = {
2+
output: {
3+
lineToLine: true,
4+
devtoolModuleFilenameTemplate: function(info) {
5+
return "dummy:///" + info.resourcePath;
6+
}
7+
},
8+
node: {
9+
__dirname: false,
10+
__filename: false
11+
},
12+
devtool: "cheap-source-map"
13+
14+
};

0 commit comments

Comments
 (0)