Socket
Socket
Sign inDemoInstall

ejs-compiled-loader-webpack4

Package Overview
Dependencies
35
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ejs-compiled-loader-webpack4

EJS webpack loader (without frontend dependencies)


Version published
Weekly downloads
35
increased by16.67%
Maintainers
1
Install size
4.08 MB
Created
Weekly downloads
 

Readme

Source

ejs-compiled-loader for webpack

EJS loader for webpack. Uses ejs function to compile templates.

To use EJS by tj use 1.x branch and 1.x.x versions.

Installation

npm install ejs-compiled-loader

Usage

Documentation: Using loaders

var template = require("ejs-compiled!./file.ejs");
// => returns the template function compiled with ejs templating engine.

// And then use it somewhere in your code
template(data) // Pass object with data

// Child Templates
// path is relative to where webpack is being run
<%- include templates/child -%>

Options

Following options can be specified in query:

beautify — enable or disable uglify-js beautify of template ast

compileDebug — see ejs compileDebug option

htmlmin — see htmlminify section

htmlminify

module: {
  loaders: [
    {test: /\.ejs$/, loader: 'ejs-compiled?htmlmin'} // enable here
  ]
},
'ejs-compiled-loader': {
  'htmlmin': true, // or enable here  
  'htmlminOptions': {
    removeComments: true
  }
}

See all options reference

License

MIT (http://www.opensource.org/licenses/mit-license.php)

Keywords

FAQs

Last updated on 04 Jul 2018

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc