Skip to content
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

讨论点问题 #1

Closed
UzkiS opened this issue Feb 11, 2023 · 2 comments
Closed

讨论点问题 #1

UzkiS opened this issue Feb 11, 2023 · 2 comments

Comments

@UzkiS
Copy link

UzkiS commented Feb 11, 2023

		rollupOptions: {
 			output: {
 				freeze: false, // vuepg插件会对导入的模块进行assign,所以这里不能freeze
 			}
 		}

看到有这么一行代码
我现在仅是开发中使用还没进行过生产环境打包过,所以并不知道在生产环境打包会出现什么情况

查询了rollup文档,了解到是关于import * as namespaceImportObject from...的使用和冻结

请问是否是指打包后无法调用各种方法呢?

原本并不打算通过这种方式导入导出变量的,但不用这种方式会让VSCode丢失注释,所以最终使用了这种方法

感觉我需要修改

@xiaoxiyao
Copy link
Owner

使用这种方式导入后,rollup会默认将导入的对象freeze,也就是不能再修改导入的对象了,所以你后面再调用assign来修改这个对象就会出错

@UzkiS
Copy link
Author

UzkiS commented Feb 11, 2023

了解🫡 谢谢 等有机会打包的时候我尝试优化下这个问题 我希望尽可能用默认配置就能跑

@UzkiS UzkiS closed this as completed Feb 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants