Embeds a script file directly into HTML. Generally the project can be used to replace any token in any files with the contents of another file.
var embedScript = require('broccoli-embed-script')
var embeddedFiles = embedScript('app'), {
fileToEmbed: 'main.js'
, inputFiles: ['**/*.html']
, token: '{{{script}}}'
})
module.exports = embeddedFiles
-
fileToEmbed
— a name of a file which should be embedded. Should be contained withing the input tree -
inputFiles
— a glob of files in whichtoken
should be replaced by the script -
token
— a token that will be replaced by the contents offileToEmbed
The project is distributed under the MIT license.