-
Notifications
You must be signed in to change notification settings - Fork 102
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
[refactor] we cannot import files directly anymore if we want to embrace pure es6 import syntax #383
Comments
Well, I found that no matter importing classes by files or modules their constructor.name will always be 't' if having So just keep the option enabled if we still use the current inject2Perceptor mechanism. |
破案了! The The problem was introduced by the transformation from commonjs modules to es6 modules. The code above worked well in |
Description
A few months ago
"keep_fnames: ture" option is for a really-hard-to-detect problem:
As we know, webpack will try its best to minimize the bundles size in build mode and one of its weapons is to substitute long variable names with short ones. Each module share a common name transformation rule because each module has its own name space when imported properly.
The problem in our code is, we import files directly by
import './xxx'
, this makes 6 transformed t to be exposed in same name space and then they conflict.So keep founction names when building bundles.
Originally posted by @tyn1998 in #274 (comment)
Today
I'm working on #381 today, and I find:
build
produced byyarn run start
works wellbuild
produced byyarn run build
fails to make contentscripts work, but Popup and Options work wellFinally I recall the 't' problem which I found a few months before and disable all
import './xxx'
butimport ./PerceptorTab
:Then PerceptorTab shows up:
Solution
This problem is related to:
So I think the refactoring work should be paused for a while until #347 comes up.
The text was updated successfully, but these errors were encountered: