inject <meta charset>
to first of <head>
.
A
<meta charset>
element in the<head>
of the document that is completely contained in the first 1024 bytes of the document
npm install --save-dev nuxt-charset-module
# OR
yarn add nuxt-charset-module
// nuxt.config.js
export default {
head: {
meta: [
- { charset: 'utf-8' },
],
},
};
// nuxt.config.js
export default {
modules: [
// 'other-module',
// 'other-module',
'nuxt-charset-module', // <- Insert to LAST!
],
};
If you use 'utf-8', You don't need to write this.
// nuxt.config.js
export default {
modules: [
'nuxt-charset-module',
],
charset: {
charset: 'utf-8', // default
},
};
// OR
export default {
modules: [
[
'nuxt-charset-module',
{
charset: 'utf-8', // default
}
],
],
};