I use webpack and babel. I pass imported models to the connectionConfig. When I build the app for production with UglifyJsPlugin, an error occurs: ER_NO_SUCH_TABLE: Table 'posts-app.e' doesn't exist
. How to avoid it without disabling the plugin? I found only one way: pass such options: mangle: {
except: ['Post','User']
}
You have such error because table names are generated from class names, e.g. Post
and User
, but when you minify your code uglifier made your names p
and e
now. You have several choices: set explicit names for your tables, e.g. @Entity("post")
and @Entity("user")
or enable mangle
(no need to specify entities, just mangle them all) or simply don't use uglify because its really pointless to use it and webpack on the backend.
I guess I've answered your question and now this issue can be closed.
@pleerock sure. Much thanks!
Most helpful comment
You have such error because table names are generated from class names, e.g.
Post
andUser
, but when you minify your code uglifier made your namesp
ande
now. You have several choices: set explicit names for your tables, e.g.@Entity("post")
and@Entity("user")
or enablemangle
(no need to specify entities, just mangle them all) or simply don't use uglify because its really pointless to use it and webpack on the backend.