Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

vue-prerender-exclude-social

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-prerender-exclude-social

A components that excludes social and tracking codes from pre-rendering usin the prerender-spa-plugin

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

vue-prerender-exclude-social

A components that excludes social and tracking codes from pre-rendering using the prerender-spa-plugin (https://www.npmjs.com/package/prerender-spa-plugin)

Example end page result can be found here http://vue-prerender-exclude-social.surge.sh/#/

Usage

  • Setup webpack in production mode

add the following to the prerender-spa-plugin

renderer: new Renderer({
  headless: false, // your choice
  captureAfterDocumentEvent: 'render-event', // your choice
  injectProperty: '$PRERENDER_INJECTED', // This is important
  inject: {
    disableNonSPAScripts: true, // Set this to true/false
  },
}),
  • Use the plugin
  import PreRenderExcludeSocial from 'vue-prerender-exclude-social';

  /**
  * Configure the pre-render plugin
  * @property gtm: {} | optional - google tag manager
  *    @property enable: true, false - enable or disable gmt
  *    @property gid: String - GMT Id like GTM-NHN7KZT
  *    @property use: Function | optional - custom function to overwrite the this plugins code injector
  * @property fbPixel: {} | optional - facebook pixel
  *    @property enable: true, false - enable or disable facebook pixel
  *    @property appId: String - fb App Id
  *    @property use: Function | optional - custom function to overwrite the this plugins code injector
  * @property fbSdk: {} - | optional facebook sdk
  *    @property enable: true, false - enable or disable facebook SDK
  *    @property appId: String - fb App Id
  *    @property use: Function | optional - custom function to overwrite the this plugins code injector
  * @property zenDesk: {} | optional - zenDesk chat
  *    @property enable: true, false - enable or disable zen desk
  *    @property key: String - Zen desk widget key
  *    @property use: Function | optional - custom function to overwrite the this plugins code injector
  */

  const config = {
    gtm: {
      enable: true,
      gid: 'GTM-NHN7KZT',
    },
    fbPixel: {
      enable: false,
      appId: 'Your App ID',
    },
    fbSdk: {
      enable: false,
      appId: 'Your App ID',
    },
    zenDesk: {
      enable: false,
      key: 'Your Key Id',
    },
  };

  Vue.use(PreRenderExcludeSocial, config);

Build Setup

# Get to test page project
cd test-page

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

# build for production and view the bundle analyzer report
npm run build --report

Keywords

prerender

FAQs

Package last updated on 30 Jun 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts