$ npm install inject-files-cli --global
$ inject-files-cli source/index.html build/index.html
$ npm install inject-files-cli --save-dev
{
...
"scripts": {
"inject": "inject-files-cli source/index.html build/index.html"
},
...
}
$ npm run inject
inject-files-cli input output [timer];
Type: string
name of input file, including relative-path and extension
Type: string
name of output file, including relative-path and extension
Type: boolean
log the time (ms) taken to inject files
Just insert a <<marker>>
in your code
<head>
<title>example</title>
<style>
<<styles/style.css>>
</style>
</head>
<body>
<p>hello world</p>
<script>
<<scripts/script.js>>
</script>
</body>
element {
style: beautiful-styles;
}
<<more-styles.css>>
function greeter() {
console.log('Hello World');
}
<<more-functions.js>>
inject-files - API for this module
GitHub: inject-files
npm: inject-files
inject-dev-server - dev server using the inject-files API
GitHub: inject-dev-server
npm: inject-dev-server