webpack
Bookmarklet loader forbookmarklet-loader is a webpack loader that will convert any javascript file into a bookmarklet that can be used as a module throughout your application.
Install
npm install bookmarklet-loader webpack --save-dev
The bookmarklet-loader requires webpack
as peerDependency
.
Usage
Apply via webpack config
moduleexports =...module:loaders:test: /\.js$/loaders: 'bookmarklet-loader'include: path;
Import into your application
;// via JSXreturn<a href=bookmarklet>Click me I am a bookmarklet</a>;// via vanilla JSlet link = document;linkhref = bookmarklet;linkinnerHTML = 'Click me, I am a bookmaklet';return link;