New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

ssi-loader

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ssi-loader

Webpack SSI loader

latest
npmnpm
Version
0.0.6
Version published
Weekly downloads
8
33.33%
Maintainers
1
Weekly downloads
 
Created
Source

ssi-loader

Webpack SSI loader

This is a very simple implementation of SSI to be used with as a webpack loader in development mode.

Support

Currently only include directives are supported:

<!-- absolute path (webpack-config location.include is needed) -->
<!--# include virtual="/includes/new/pre/async" -->

<!-- relative path -->
<!--# include virtual="./includes/new/pre/async" -->

<!-- relative path  ('@'' means root of the project)  -->
<!--# include virtual="@/includes/new/pre/async" -->

Config

Inside your webpack.dev.config.js file just add the reference to ssi-loader:

// webpack.dev.config.js

module: {
  rules: [{
    test: /\.html?$/,
    use: [
      {
        loader: 'html-loader' // Used to output as html
      },
      {
        loader: 'ssi-loader',
        options: {
          locations: {
            "include": "https://github.com/Jogiter/ssi-loader",
          }
        }
      }
    ]
  }]
}

This will replace all SSI directives with the actual include content. The ssi-loader only handles the server side includes, in order to return a valid webpack source you can use the html-loader like shown in the previous example.

to-think

ssi-loader,会将 ssi 内的内容替换掉页面的注释语法 。而实际上,希望 ssi 更新后可以实时更新,在产品模式不使用ssi-loader,只在在生产模式使用。

html-webpack-plugin 最新版不支持 3.x webpack

ssi-loader bugs:

  • 支持本地 & 远程 ssi
  • 开发时,无法监控实时更新(随意修改本地的,会重新拉取远程或者本地的数据)
  • 目前仅支持 webpack 3.x,不支持 4.x

LICENSE

WTFPL

Keywords

ssi

FAQs

Package last updated on 14 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