我正在开发一个用 Vue.js 开发的单页应用程序,托管在 Node.js 服务器上。
目前它仍在开发中,但最终将暴露给外部客户,并且由于我们将处理敏感数据,我们希望避免在用户检查元素时看到 .vue 文件和相对文件树结构在开发工具中。
See attached screenshot as a sample that shows the files I would like to hide.
![enter image description here](https://i.stack.imgur.com/TRF1P.jpg)
有办法实现吗?
通过使用配置文件,我能够使 webpack 将 SPA 导出到捆绑包中。
在文件中./config/index.js
我更改了以下标志:
build: {
// other code...
devtool: '', // Previously it was set as '#source-map'
productionSourceMap: false, // Previously it was set as true
cssSourceMap: false, // Previously set as true
// other code...
}
我通过阅读 webpack 文档找到了解决方案,其中解释了设置的作用:https://webpack.js.org/configuration/devtool/#product https://webpack.js.org/configuration/devtool/#production
感谢大家让我走上正确的方向。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)