项目结构如下 Project ├─ static │ └─ const.js └─components └─ Test.vue const.js代码 ``` javascript export default {} ``` Test.vue ``` vue <script> import test from '../static/const.js" <script> ``` 当第一次编译项目或发行时,会出现找不到test的问题,但热编译后正常 经过排查问题,第一次编译或发行时,const,js被编译为 ``` javascript export default {} ``` 但热编译后const.js被编译为 ``` javascript "use strict" const test ={} exports.test=test; ``` 将const.js改为 ``` javascript export const test = {} ``` 后解决问题