GithubHelp home page GithubHelp logo

ne-ssi-loader's Introduction

ne-ssi-loader

🏈Webpack SSI loader for NETEASE

一个简单的Webpack SSI loader,在cms项目中使用。比其他ssi-loader相比,可以设置远程include的charset设置。

支持语法

<!-- 远程路径 -->
<!--#include virtual="/special/f2e/cn_head_static.html"-->

<!-- 本地路径 -->
<!--#include file="inc/head_static.html"-->

<!-- 别名路径,使用webpack的别名('@'' means root of the project)  -->
<!--# include virtual="@/head.html" -->

目前只支持绝对路径读取线上资源,相对路径读取本地资源不支持路径中包含变量的情况

设置

// webpack.dev.config.js

module: {
  rules: [{
    test: /\.html?$/,
    use: [
      {
        loader: 'html-loader' // Used to output as html
      },
      {
        loader: 'ne-ssi-loader',
        options: {
          remote: {
            locations: 'https://news.163.com/',
            charset: 'GBK'
          },
          local: {
            charset: ''
          },
          build: 'src' // 是否替换资源。'src'只替换本地SSI,适合production模式,'build'只替换远程SSI。默认全部替换,适合dev模式。
        }
      }
    ]
  }]
}

LICENSE

WTFPL

基于ssi-loader修改

ssi-loader

ne-ssi-loader's People

Watchers

James Cloos avatar zz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.