grunt-webify v0.1.3
grunt-webify
Install:
npm install grunt-webify --save-devWhat it does
Injects CSS, Javascript, EMCAScript6, SCSS, and CommonJS dependencies into HTML, EJS & DUST files.
Given an ejs (embedded javascript) file for example:
<html>
<head>
<title>Index Page</title>
<style src="index.scss"></style>
<script src="index.js"></script>
</head>
<body>
<h1><%= title %></h1>
<p>sdfsdfds</p>
</body>
</html>SCSS files are compiled into to CSS files and javascript files are browserified (using another project called browserify) to get compiled versions with commonjs dependencies injected before being injected into the a completed file.
Options
jst
Compiles HTML & EJS files into a template function.
esnext
This causes all EMCAScript 6 syntax to be automatically transpiled down to EMCAScript 5. This also affects the module system as it lets you do:
import $ from "jquery" which is equivalent to var $ = require("jquery")
import { model } from "mongoose" which is equivalent to var model = require("mongoose").model;
import { model, Model } from "mongoose" which is equivalent to var model = require("mongoose").model, Model = require("mongoose").Model;
banner
Adds a banner to the top of every file