Skip to content
This repository was archived by the owner on Mar 17, 2021. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: webpack-contrib/file-loader
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.11.1
Choose a base ref
...
head repository: webpack-contrib/file-loader
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.11.2
Choose a head ref
  • 4 commits
  • 5 files changed
  • 4 contributors

Commits on Apr 15, 2017

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    26ab81a View commit details

Commits on Jun 2, 2017

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    d4d8bbc View commit details

Commits on Jun 3, 2017

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    e4c0b2a View commit details

Commits on Jun 5, 2017

  1. chore(release): 0.11.2

    joshwiens committed Jun 5, 2017
    Copy the full SHA
    743aef2 View commit details
Showing with 28 additions and 4 deletions.
  1. +11 −0 CHANGELOG.md
  2. +2 −1 README.md
  3. +2 −2 index.js
  4. +1 −1 package.json
  5. +12 −0 test/correct-filename.test.js
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,17 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

<a name="0.11.2"></a>
## [0.11.2](https://github.com/webpack/file-loader/compare/v0.11.1...v0.11.2) (2017-06-05)


### Bug Fixes

* **index:** allow to override publicPath with an empty string ([#145](https://github.com/webpack/file-loader/issues/145)) ([26ab81a](https://github.com/webpack/file-loader/commit/26ab81a))
* init `publicPath` to undefined ([#159](https://github.com/webpack/file-loader/issues/159)) ([e4c0b2a](https://github.com/webpack/file-loader/commit/e4c0b2a))



<a name="0.11.1"></a>
## [0.11.1](https://github.com/webpack/file-loader/compare/v0.11.0...v0.11.1) (2017-04-01)

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@
src="https://webpack.js.org/assets/icon-square-big.svg">
</a>
<h1>File Loader</h1>
<p>Instructs webpack to emit the required object as file and to return its public url.</p>
</div>

<h2 align="center">Install</h2>
@@ -152,4 +153,4 @@ MIT
[cover-url]: https://coveralls.io/github/webpack-contrib/file-loader

[chat]: https://badges.gitter.im/webpack/webpack.svg
[chat-url]: https://gitter.im/webpack/webpack
[chat-url]: https://gitter.im/webpack/webpack
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ module.exports = function(content) {
var configKey = query.config || "fileLoader";
var options = this.options[configKey] || {};
var config = {
publicPath: false,
publicPath: undefined,
useRelativePath: false,
name: "[hash].[ext]"
};
@@ -61,7 +61,7 @@ module.exports = function(content) {
}

var publicPath = "__webpack_public_path__ + " + JSON.stringify(url);
if (config.publicPath) {
if (config.publicPath !== undefined) {
// support functions as publicPath to generate them dynamically
publicPath = JSON.stringify(
typeof config.publicPath === "function"
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "file-loader",
"version": "0.11.1",
"version": "0.11.2",
"author": "Tobias Koppers @sokra",
"description": "file loader module for webpack",
"files": [
12 changes: 12 additions & 0 deletions test/correct-filename.test.js
Original file line number Diff line number Diff line change
@@ -92,6 +92,18 @@ describe("publicPath option", function() {
'module.exports = "http://cdn/81dc9bdb52d04dc20036dbd8313ed055.txt";'
);
});

it("should override public path when given empty string", function() {
run("file.txt", "publicPath=").result.should.be.eql(
'module.exports = "81dc9bdb52d04dc20036dbd8313ed055.txt";'
);
});

it("should use webpack public path when not set", function() {
run("file.txt").result.should.be.eql(
'module.exports = __webpack_public_path__ + "81dc9bdb52d04dc20036dbd8313ed055.txt";'
);
});
});

describe("useRelativePath option", function() {