我想从项目的根目录中延迟加载test.js文件,但出现错误,请帮助我解决该问题。错误Syntax Error: SyntaxError: Unexpected token (27:30)
是此导入const getMockedClient = () => import("test.js")
main.js
const getMockedClient = () => import("./test.js")
Vue.config.productionTip = false
Vue.use(Vuetify, vuetifyConfig)
Vue.use(VueApollo)
test.js
const Cat = {
meow () {
console.log("Meowwwww!")
}
}
export default Cat
webpack配置
module.exports = {
dev: {
assetsSubDirectory: "static",
assetsPublicPath: "/",