Description
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
If an exported value contains a reference to an imported value followed by a comma, the reference to the imported value isn't replaced.
If the current behavior is a bug, please provide the steps to reproduce.
See chrisdoble/css-loader-bug.
What is the expected behavior?
In the example repository above, I expected the first occurrence of the color
variable to be replaced with the value of the color
variable.
Please mention other relevant information such as your webpack version, Node.js version and Operating System.
webpack: 2.2.1
Node.js: 7.6.0
OS: OS X 10.10.5
I believe this issue is caused by incorrect tokenisation here, e.g.
> "0 0 color, 0 0 color".split(/(\S+)/)
["", "0", " ", "0", " ", "color,", " ", "0", " ", "0", " ", "color", ""]
Note that the first occurrence of the color
variable includes a trailing comma which will cause the import lookup to fail.