We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
用ts 通过装饰器@component创建的组件无法定义名称,打包编译后组件类名被压缩,导致执行createAPI时获取不到component name名称
是否能在执行createAPI时定义自定义组件名称
Component must have name while using create-api!
The text was updated successfully, but these errors were encountered:
强烈建议在 createAPI 执行时, 支持传入函数或字符串来定义组件名称 前面是用这个插件terser-webpack-plugin解决的, 但是最近这个插件自动升级后, 影响到 photoswipe 的使用了(无法打开大图预览)
terser-webpack-plugin
Sorry, something went wrong.
目前可以通过修改webpack的(terser)配置解决这个问题,已防止打包编译时组件名称被修改。 由于组件最终是被编译成function,所以要设置keep_fnames为true,防止丢弃或破坏函数名。
// vue.config.js chainWebpack: config => { config.optimization.minimizer('terser').tap(args => { args[0].terserOptions.keep_fnames = true return args }) }
上面是 Vue CLI v4的配置,v3的配置可参考https://cli.vuejs.org/migrating-from-v3/#vue-cli-service
No branches or pull requests
用ts 通过装饰器@component创建的组件无法定义名称,打包编译后组件类名被压缩,导致执行createAPI时获取不到component name名称
是否能在执行createAPI时定义自定义组件名称
Component must have name while using create-api!
The text was updated successfully, but these errors were encountered: