扩展 Webpack – 是否与云兼容?

huangapple go评论60阅读模式
英文:

Extending Webpack - Is it cloud compatible?

问题

我在这里提出了这个问题:https://stackoverflow.com/questions/76388425/javascript-plugin-and-environment-variables

虽然解决方案在开发环境(自托管的Shopware)中完美运行,但我想知道它是否会在Shopware云环境中运行。在提交应用之前,我应该考虑什么?是否应该包括“dist”和“build”目录以及“.env”文件?

英文:

I asked this question here: https://stackoverflow.com/questions/76388425/javascript-plugin-and-environment-variables

While the solution is perfectly working in a dev (self-hosted Shopware) environment I would like to know if it will be working in the Shopware cloud environment. What should I consider when archiving the app before submission? Should the "dist" and "build" directories and the ".env" file be included?

答案1

得分: 1

如果你想发布你的插件/应用程序,必须在存档中包含预编译的资产,放在dist目录下。这不仅适用于云托管,而且适用于一般的所有生产环境,因为在生产服务器上不要求安装nodejs,所以不能指望用户编译你的源代码。无论如何,你应该包括所有的源代码(srcbuild目录以及在你的特定情况下.env文件),以防他们在某个时候想重新编译这些资产。

英文:

If you want to publish your plugin/app, you must include the pre-compiled assets within the dist directory in the archive. This is not only required for cloud hosted but for all production environments in general, as nodejs is not a requirement on production servers, so you can't expect the users to compile your sources. You should include all of your sources (src and build directory and in your specific case the .env file) nonetheless, just in case they do want to re-compile the assets at some point.

huangapple
  • 本文由 发表于 2023年6月5日 16:21:11
  • 转载请务必保留本文链接:https://go.coder-hub.com/76404631.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定