Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for default source map extensions
- Loading branch information
1 parent
12762ff
commit a2cc031
Showing
10 changed files
with
66 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
test/configCases/source-map/default-filename-extensions-css/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
it("creates source maps for .css output files by default", function() { | ||
var fs = require("fs"); | ||
var source = fs.readFileSync(__filename, "utf-8"); | ||
var match = /sourceMappingURL\s*=\s*(.*)\*\//.exec(source); | ||
expect(match[1]).toBe("bundle0.css.map"); | ||
}); |
3 changes: 3 additions & 0 deletions
3
test/configCases/source-map/default-filename-extensions-css/test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
var foo = {}; | ||
|
||
module.exports = foo; |
12 changes: 12 additions & 0 deletions
12
test/configCases/source-map/default-filename-extensions-css/webpack.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module.exports = { | ||
mode: "development", | ||
output: { | ||
filename: "bundle0.css" | ||
}, | ||
node: { | ||
__dirname: false, | ||
__filename: false | ||
}, | ||
devtool: "source-map" | ||
}; | ||
|
6 changes: 6 additions & 0 deletions
6
test/configCases/source-map/default-filename-extensions-js/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
it("creates source maps for .js output files by default", function() { | ||
var fs = require("fs"); | ||
var source = fs.readFileSync(__filename, "utf-8"); | ||
var match = /sourceMappingURL\s*=\s*(.*)/.exec(source); | ||
expect(match[1]).toBe("bundle0.js.map"); | ||
}); |
3 changes: 3 additions & 0 deletions
3
test/configCases/source-map/default-filename-extensions-js/test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
var foo = {}; | ||
|
||
module.exports = foo; |
12 changes: 12 additions & 0 deletions
12
test/configCases/source-map/default-filename-extensions-js/webpack.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module.exports = { | ||
mode: "development", | ||
output: { | ||
filename: "bundle0.js" | ||
}, | ||
node: { | ||
__dirname: false, | ||
__filename: false | ||
}, | ||
devtool: "source-map" | ||
}; | ||
|
6 changes: 6 additions & 0 deletions
6
test/configCases/source-map/default-filename-extensions-mjs/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
it("creates source maps for .mjs output files by default", function() { | ||
var fs = require("fs"); | ||
var source = fs.readFileSync(__filename, "utf-8"); | ||
var match = /sourceMappingURL\s*=\s*(.*)/.exec(source); | ||
expect(match[1]).toBe("bundle0.mjs.map"); | ||
}); |
3 changes: 3 additions & 0 deletions
3
test/configCases/source-map/default-filename-extensions-mjs/test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
var foo = {}; | ||
|
||
module.exports = foo; |
12 changes: 12 additions & 0 deletions
12
test/configCases/source-map/default-filename-extensions-mjs/webpack.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module.exports = { | ||
mode: "development", | ||
output: { | ||
filename: "bundle0.mjs" | ||
}, | ||
node: { | ||
__dirname: false, | ||
__filename: false | ||
}, | ||
devtool: "source-map" | ||
}; | ||
|