1.1.3 • Published 6 years ago

grunt-inlines v1.1.3

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

grunt-inlines

grunt-inlines helps you insert code which have been minified inline your file, it supports css and html files.

Usage

In your Gruntfile.js, write like below:

inlines: {
  options: {
    cssmin: true,
    htmlmin: true,
    htmlminOptions: {
      // Please references https://www.npmjs.com/package/html-minifier#options-quick-reference  
    }
  },
  files: {
    src: ...,
    dist: ...
  }
}

then, you can invoke function __inline in your javascript file, just like this:

// demo.js
// be sure that ./css/style.css exists
var styleCSS = __inline("./css/style.css")
var template = __inline("./html/footer.html")

and ./css/style.css file's content is:

.name {
  color: red;  
}

and ./html/footer.html file's content is:

<footer>
this is footer
</footer>

after compiled by grunt, demo.js would become:

var styleCSS = '.name{color:red}'
var template = '<footer>this is footer</footer>'
1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago