Skip to content
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

feat(basePath): use basePath for keys only #74

Merged
merged 1 commit into from
Aug 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ The manifest filename in your output directory.

Type: `String`

A path prefix for all file references. Useful for including your output path in the manifest.
A path prefix for all keys. Useful for including your output path in the manifest.


### `publicPath`

Type: `String`

A path prefix used only on output files, similar to Webpack's [output.publicPath](https://github.com/webpack/docs/wiki/configuration#outputpublicpath). Ignored if `basePath` was also provided.
A path prefix used only on output files, similar to Webpack's [output.publicPath](https://github.com/webpack/docs/wiki/configuration#outputpublicpath).


### `stripSrc`
Expand Down
5 changes: 3 additions & 2 deletions lib/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,11 @@ ManifestPlugin.prototype.apply = function(compiler) {
if (this.opts.basePath) {
files = files.map(function(file) {
file.name = this.opts.basePath + file.name;
file.path = this.opts.basePath + file.path;
return file;
}.bind(this));
} else if (this.opts.publicPath) {
}

if (this.opts.publicPath) {
// Similar to basePath but only affects the value (similar to how
// output.publicPath turns require('foo/bar') into '/public/foo/bar', see
// https://github.com/webpack/docs/wiki/configuration#outputpublicpath
Expand Down
4 changes: 2 additions & 2 deletions spec/plugin.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ describe('ManifestPlugin', function() {
}
}, function(manifest, stats) {
expect(manifest).toEqual({
'/app/one.js': '/app/one.' + stats.hash + '.js'
'/app/one.js': 'one.' + stats.hash + '.js'
});

done();
Expand Down Expand Up @@ -210,7 +210,7 @@ describe('ManifestPlugin', function() {
}
}, function(manifest, stats) {
expect(manifest).toEqual({
'https://www/example.com/one.js': 'https://www/example.com/one.js'
'https://www/example.com/one.js': 'one.js'
});

done();
Expand Down