我有這樣一個包,結構如下index.jsimport apiList from './interface'const install = Vue => { if (install.installed) return;
install.installed = true
Object.defineProperties(Vue.prototype, {
api: { get() { return apiList }
}
})
}export default install當在我這樣引入包能正常運行import api from '@/assets/js/http/index'但是這樣就不行import api from '@/assets/js/http'不是說 webpack 引入包名,會自動找 index.js 或 package.json的main字段嗎?但是我這里直接引入包名'@/assets/js/http'無效是什么問題?
自定義包 import 找不到 index.js
慕工程0101907
2019-03-07 16:31:33