1.1.1 • Published 2 months ago

vite-plugin-adsense v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

vite-plugin-adsense

Insert Google AdSense script to index.html and create ads.txt file.

Why or who need it?

If your code powers many different websites, and each site use a different AdSense account, this plugin is made for you. You can configure different AdSense account in .env file for each site.

Install

npm i vite-plugin-adsense

Usage

It is recommended to save your client id into .env file.

# .env
VITE_ADSENSE_CLIENT=ca-pub-1234567890123456
// vite.config.ts
import { defineConfig } from 'vite';
import adsense from 'vite-plugin-adsense';

export default defineConfig({
  plugins: [adsense()],
});

If you have more advanced usage, you can also pass client to plugin options.

// vite.config.ts
import { defineConfig } from 'vite';
import adsense from 'vite-plugin-adsense';

export default defineConfig({
  plugins: [
    adsense({
      client: 'ca-pub-1234567890123456',
    }),
  ],
});
1.1.1

2 months ago

1.1.0

2 months ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago