Combination of devtool: ‘source-map’ and library: [‘Foo’, ‘[name]’] throws error

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
With the following configuration, webpack throws the following error

module.exports = {
  devtool: 'source-map',
  output: {
    library: ['Foo', '[name]']
  }
}
webpack-bug-test$ npm run build                                                                                                                                                                                 

> webpack-bug-test@1.0.0 build /Users/jason/Projects/webpack-bug-test
> webpack

/Users/jason/Projects/webpack-bug-test/node_modules/webpack-cli/bin/webpack.js:439
                                throw err;
                                ^

ValidationError: SourceMap DevTool Plugin Invalid Options

options.namespace should be string

If the current behavior is a bug, please provide the steps to reproduce.
The proceeding config is enough to produce the issue.

What is the expected behavior?
The proceeding config should build without issue, as was the case with versions prior to 4.

If this is a feature request, what is motivation or use case for changing the behavior?
N/A

Please mention other relevant information such as the browser version, Node.js version, webpack version, and Operating System.
4.0.1 (Previously working on 3.8.1)

Author: Fantashit

1 thought on “Combination of devtool: ‘source-map’ and library: [‘Foo’, ‘[name]’] throws error

  1. Array for library is valid (it does mean Foo.[name]).
    When passing library as namespace we should use [].concat(output.library).join("."). Somebody wants to send a PR?

Comments are closed.