🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

vite-plugin-ssinc

Package Overview
Dependencies
Maintainers
0
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vite-plugin-ssinc

The plugin for including SSI-like includes in Vite.

1.0.11
latest
Source
npm
Version published
Weekly downloads
9
-47.06%
Maintainers
0
Weekly downloads
 
Created
Source

Vite Plugin Ssinc

Vite Plugin Ssinc is a plugin for Vite that allows for Server Side Includes like syntax (with only #include supported) to be used in HTML files.

Installation

You can install the plugin using npm:

npm install vite-plugin-ssinc

or yarn:

yarn add vite-plugin-ssinc

Usage

To use Vite Plugin Ssinc, add the following to your Vite configuration file.

// vite.config.js
import vitePluginSsinc from 'vite-plugin-ssinc';

export default {
  plugins: [
    vitePluginSsinc({
      includeExtensions: ['shtml', 'html'],
    }),
  ],
};

If you want to write it in CommonJS syntax, you can do it like this:

// vite.config.js
const vitePluginSsinc = require('vite-plugin-ssinc').default;

export default {
  plugins: [
    vitePluginSsinc({
      includeExtensions: ['shtml', 'html'],
    }),
  ],
};

In your HTML files, you can use SSI directives like so:

<!DOCTYPE html>
<html>
  <head>
    <title>Vite Plugin Ssinc</title>
  </head>
  <body>
    <!--# include file="header.shtml" -->
    <h1>Welcome to Vite Plugin Ssinc</h1>
    <!--# include virtual="/footer.shtml" -->
  </body>
</html>

When Vite serves your site, the SSI directives will be processed and the included files will be included in the HTML response.

Options

OptionTypeDefaultRequiredDescription
includeExtensionsArray<string>['shtml']NoAn array of file extensions that should be checked for SSI directives.
apply'serve' | 'build'NoneNoThe mode in which the plugin should be applied. By default, the plugin will be applied in both development and production builds.

License

Vite Plugin Ssinc is licensed under the MIT License.

Keywords

vite

FAQs

Package last updated on 24 Aug 2024

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