Closed Julyzl closed 2 months ago
what is wrong?错误信息是啥?
报错信息: vue3-sfc-loader.js?v=4c92af84:24805 Uncaught (in promise) TypeError: Unable to handle files (scss)
这是我的示例,这样写scss就不会报Unable to handle files (scss)这个错了
但是写lang=scss 没有效果,就像好像没写样式一样 你那边有示例吗?
it's my example,But it didn't work,Can the author write an example,thanks! import sassloader from 'sass-loader' options: { moduleCache: { vue: Vue, dayjs: dayjs, scss: (source) => Object.assign(sass(source), { deps: () => [] }) // (source) => Object.assign(sass(source), { deps: () => [] }) }, // 获取文件 async getFile(url: any) { const res = await fetch(url) if (!res.ok) throw Object.assign(new Error(url + ' ' + res.statusText), { res }) return await res.text() }, // 添加样式 addStyle(textContent: any) { const style = Object.assign(document.createElement('style'), { textContent }) const ref = document.head.getElementsByTagName('style')[0] || null document.head.insertBefore(style, ref) } }