Incompatibility with unplugin-icons
Akryum opened this issue · comments
The default alias { find: /^~/, replacement: '' }
removes the ~
in ~icons/...
paths breaking unplugin-icons.
Example path: ~icons/feather/search
yes it is not css-loader syntax but weird… will hack handle it.
Workaround vite plugin:
{
name: 'vite-fix-unplugin-icons',
enforce: 'post',
config (config) {
// https://github.com/IndexXuan/vue-cli-plugin-vite/issues/49
const index = config.resolve.alias.findIndex(a => a.find.toString() === '/^~/')
if (index !== -1) config.resolve.alias.splice(index, 1)
},
}
really. just remove it will make some css-loader syntax compat failed.
https://github.com/IndexXuan/vite-plugin-vue-cli/blob/main/src/index.ts#L128
I think we can change this regexp except for icons. can you try?
Maybe it could be configurable?
your regexp works? I will try it tomorrow. If it works, I dont think it need configurable.
@Akryum publish v1.4.9 by update inner vite-plugin-vue-cli
for alias regexp you provided. It works for me.
https://github.com/IndexXuan/vue-cli-plugin-vite/blob/main/examples/my-spa-js-app/src/App.vue#L11
https://github.com/IndexXuan/vue-cli-plugin-vite/blob/main/examples/my-spa-js-app/vue.config.js#L8-L13
aha, unplugin
and vue-cli-plugin-vite
plays well in nature, very nice ~
examples use vue-cli(yarn build) will report error of sourcemap ... so I comment it ...
yarn vite:build is right.
I dont know. maybe unplugin-icons
issue.