Staticfy your website
This plugin requires Grunt
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-staticfy --save-dev
In your project's Gruntfile, add a section named
staticfy to the data object passed into
Here is the a html with script:
The script on page
document.writeln('success'); would be executed and the compiled page is:
Once the page is loaded, the inject script would be executed.
This is the original html, no script on page.
The inject script
document.body.innerHTML = 'this line is made by inject script'; would be executed, so the compiled html is:
this line is made by inject script
<!-- remove start -->this will be remove<!-- remove end -->this will not be remove
this will not be remove
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
git checkout -b my-new-feature)
git commit -am 'Add some feature')
git push origin my-new-feature)