I had a Vite project for Vue2, It include a static html file.
like following
import template from 'editor.html';
export default {
template: template
}
When I ran yarn dev
, Terminal output:
node_modules/@gaoding/editor-framework/lib/base/editor.js:23:21: error: No loader is configured for ".html" files: node_modules/@gaoding/editor-framework/lib/base/editor.html 23 │ import template from './editor.html';
I tried to add some plugin below in vite.config.ts
, But all of these didn't work.
@rollup/plugin-html
rollup-plugin-html
rollup-plugin-htmlvue
How can I solve this problem.
adding ?raw
at the end of the import can address the issue:
import template from "./contact-list.html?raw";
I'm still looking for a solution how to set it globally for all HTML files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With