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
DefinePlugin regression #8293
Comments
I got some initial investigation: Changing the return value to I can try to send out a fix for it. |
new webpack.DefinePlugin({
- NAME: 'foobar'
+ NAME: '"foobar"'
}) |
hmm seems like to intentionally passed an expression. Than it seems to be a bug. As workaround: const name = NAME;
import(`./${name}.yaml`) |
Sorry for my ambiguous test, it should be:
then:
expands to:
|
ah ok. That seem to be different. |
Yes, but in both situations, something is not properly expanded. |
@sokra, it seems that the problem is still present (in v4.25.0)
|
It works at my side, check https://github.com/ljqx/webpack-test-import-parser. The fix only works for template string, it doesn't include fix for string concated by I can have a try. |
I already have a fix. Sorry didn't read your comment. |
Bug report
What is the current behavior?
DefinePlugin does not replace things in all situations.
I encounter this issue while upgrading from webpack v3.6.0 to v4.23.1
If the current behavior is a bug, please provide the steps to reproduce.
then:
expands to:
that is not correct.
Other relevant information:
webpack version: 4.23.1
Node.js version: 10.10
Operating System: win7
Additional tools:
The text was updated successfully, but these errors were encountered: