Giter Site home page Giter Site logo

sylrob / webpack-ssi-include-loader Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 1.0 387 KB

scrap an html content looking for SSI include template string,

JavaScript 2.19% HTML 97.81%
developer-tools development-environment loader ssi webpack webpack-ssi

webpack-ssi-include-loader's People

Contributors

dependabot[bot] avatar sylrob avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

sn00pee

webpack-ssi-include-loader's Issues

Is this the correct condition?

Hey.
I decided to try your package in my application and ran into a problem.
Because of this condition, nothing is displayed for me, is it exactly correct?

if (res && !res.statusCode && !res.statusCode >= 400) {

I receive a status of 200 and a response body, but in the end I get an error that the file was not found.

[BUG] Whitespace removed unexpectedly

If I have some html markup like the following and set html-loader option minimize: false:

    <div
      class="test"
      another-attr="true"
      another-attra="true"
      another-attrb="true"
      another-attrc="true"
    ></div>

the whitespace will be removed and the html will be invalidly displayed as:

<divclass="test"another-attr="true"another-attra="true"another-attrb="true"another-attrc="true"></div>

problematic location:

// ssi.js

    const splitContent = content.split('\n');
    // eslint-disable-next-line
    for (const line of splitContent) {
      const part = line.trim();
      output += await processInclude(part, i);
    }

[BUG] onFileMatch is not pass to the script

Original

module.exports = function (source) {
  const cb = this.async();
  const ssi = new SSI({
    ...this.query,
    onFileMatch: (filePath, fileContent, isLocal) => {
      if (fileContent && isLocal) {
        // so the file can be "watch" by webpack
        this.addDependency(filePath);
      }
    },
  });

this does not mention the this.query.onFileMatch(filePath, fileContent, isLocal)

this will be fix in the next release

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.