-
Notifications
You must be signed in to change notification settings - Fork 52
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
Webpack mangle is not parsed #203
Labels
Comments
@herregroen Since you've worked on this, perhaps you have some thoughts about that? |
@swissspidy @herregroen I have now taken the initiative myself and opened a pull request: #204 🙂 |
swissspidy
added a commit
that referenced
this issue
Mar 2, 2020
fix(make-pot): parses mangled webpack statements (closes #203)
schlessera
pushed a commit
that referenced
this issue
Jan 6, 2022
schlessera
pushed a commit
that referenced
this issue
Jan 6, 2022
fix(make-pot): parses mangled webpack statements (closes #203)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Report
Describe the current, buggy behavior
I am using webpack (in my WordPress boilerplate https://github.com/devowlio/wp-react-starter) and want to extract strings (
make-pot
) from my bundled.js
file. My file contains this code:As long as it looks like this, it works as expected. The coding covers that case:
i18n-command/src/JsFunctionsScanner.php
Lines 212 to 239 in 79d9c75
But, due to the fact I need to rely on webpack's
splitChunks
and some otheroptimizations
(usedExports
andsideEffects
) it no longer works because the output looks like this:You see, it creates an inline comment
/* __ */
with the function name (can be also_n
or whatever).Describe how other contributors can replicate this bug
I can not tell you the exact webpack configuration as it is very complicated, but you could do the following:
.js
file__WEBPACK_IMPORTED_MODULE
"__"
with/* __ */ "a"
Edit: You can also create a
test.js
file with the following content:Describe what you would expect as the correct outcome
Should parse the string
Try again
correctly to.pot
file.Let us know what environment you are running this on
Provide a possible solution
I do not exactly know how that works with
Peast
but perhaps we can check for the inline comment (trimmed).The text was updated successfully, but these errors were encountered: