
Research
/Security News
Toptal’s GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
rollup-plugin-fill-html
Advanced tools
Fill the html template with the bundle js..
The 1.0.3 version has been supported to insert css file and external url, you should know that rollup-plugin-fill-html will scan the dest directory and find out the bundl js and all the css files
, and then into the result html. So you'd better to clean the dest directory before rebuilding, and I think you may need this .
yarn add --dev rollup-plugin-fill-html
or
npm install -D rollup-plugin-fill-html
In the rollup.config.js:
import html from 'rollup-plugin-fill-html';
export default {
entry: 'src/index.js',
dest: 'dist/bundle.js',
plugins: [
html({
template: 'src/index.html',
filename: 'index.html'
})
]
};
and then a index.html file will be created in the dest directory(where the bundle file will be).
With rollup-plugin-fill-html
, you can set a format string which with '[hash]' for the dest in rollup.config.js, just like:
export default {
entry: 'src/index.js',
dest: 'dist/bundle-[hash].js',
plugins: [
...
]
};
and then, you will get bundle-a3965c0c77a63d7c74b57222e2f74028.js
in your dist directory.
You can pass an option to the html()
just like above, and there are some options:
demo:
// rollup.config.js
import html from 'rollup-plugin-fill-html';
export default {
entry: 'src/index.js',
target: [
{ format: 'cjs', dest: 'dist/index.cjs.js' },
{ format: 'es', dest: 'dist/index.es.js' }
],
plugins: [
html({
template: 'src/index.html',
filename: 'index.html',
format: 'es',
externals: [
{ type: 'js', file: '//www.test.pajkdc.com/hybridjs/pajk_hybrid_index.0.1.4.js' },
{ type: 'js', file: '//beacon.test.pajkdc.com/js/beacon.js' }
]
})
]
};
then the dist/index.es.js
will be inserted into the result file.
MIT
FAQs
fill html with the bundle file
The npm package rollup-plugin-fill-html receives a total of 133 weekly downloads. As such, rollup-plugin-fill-html popularity was classified as not popular.
We found that rollup-plugin-fill-html demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.