GithubHelp home page GithubHelp logo

men232 / nunjucks-minify-loaders Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 3.0 24 KB

Passing source from loader via html-minifier

License: BSD 2-Clause "Simplified" License

JavaScript 75.02% HTML 24.98%

nunjucks-minify-loaders's People

Contributors

felipemsantana avatar petitchevalroux avatar ratson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

nunjucks-minify-loaders's Issues

npx @11ty/eleventy doesn't finish

With this configuration:

const loader = new FileMinifyLoader("src/includes", {
  watch: true,
  noCache: false,
});
const nunjucksEnvironment = new Nunjucks.Environment(loader);

eleventyConfig.setLibrary("njk", nunjucksEnvironment);

The command npx @11ty/eleventy hangs after copying files. The same command with the --serve flag works fine.

Switching out the config for the default config (provided below) doesn't hang.

const nunjucksEnvironment = new Nunjucks.Environment(
    new Nunjucks.FileSystemLoader("src/includes")
  );

eleventyConfig.setLibrary("njk", nunjucksEnvironment);

So it has to be an issue with this module... Any help?

How to use custom tag?

In my case I need to use custom tag, for example:
tags: {//change default tags for support vue. blockStart: '<%', blockEnd: '%>', variableStart: '<<', variableEnd: '>>', commentStart: '<#', commentEnd: '#>' }
But this is not working and thrown error.
How to use custom tag/filters ?

Check if minify have error.

If minify cannot process file then whole server will be down! How to handle minify error? May be using try/catch?
result.src = minify(result.src, this.minifyOpts)

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.