diff --git a/cypress/integration/spec.js b/cypress/integration/spec.js index 82a6e50..c6feff2 100644 --- a/cypress/integration/spec.js +++ b/cypress/integration/spec.js @@ -44,4 +44,12 @@ describe('Vite SVG Loader', () => { it('supports ?raw param', () => { cy.get('#raw').contains('') }) + + it('ignores root files references', () => { + cy.get('#root img') + .should('exist') + .and(($img) => { + expect($img[0].width).to.equal(355) + }) + }) }) diff --git a/examples/vue/public/root.svg b/examples/vue/public/root.svg new file mode 100644 index 0000000..52075fa --- /dev/null +++ b/examples/vue/public/root.svg @@ -0,0 +1,4 @@ + + diff --git a/examples/vue/src/App-url.vue b/examples/vue/src/App-url.vue index c619a16..c036c83 100644 --- a/examples/vue/src/App-url.vue +++ b/examples/vue/src/App-url.vue @@ -35,5 +35,9 @@ const Async = defineAsyncComponent(() => import(`./assets/circle.svg?component`) {{ testRaw }} +