nuxt-charset-module

0.2.1 • Public • Published

nuxt-charset-module

inject <meta charset> to first of <head>.

Why

https://web.dev/charset/

A <meta charset> element in the <head> of the document that is completely contained in the first 1024 bytes of the document

Setup

Install

npm install --save-dev nuxt-charset-module
# OR
yarn add nuxt-charset-module

Remove current charset

 // nuxt.config.js
 
 export default {
   head: {
     meta: [
-      { charset: 'utf-8' },
     ],
   },
 };

Load Module

// nuxt.config.js

export default {
  modules: [
    // 'other-module',
    // 'other-module',
    'nuxt-charset-module', // <- Insert to LAST!
  ],
};

Add Options

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
      }
    ],
  ],
};

Readme

Keywords

none

Package Sidebar

Install

npm i nuxt-charset-module

Weekly Downloads

1

Version

0.2.1

License

MIT

Unpacked Size

2.79 kB

Total Files

3

Last publish

Collaborators

  • amotarao