diff --git a/README.md b/README.md index 8da5147..5d28fec 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ javascript:(function () { var script = document.createElement('script'); script. You can get it on npm. ```bash -npm install eruda --save +npm install eruda --save-dev ``` Add this script to your page. @@ -86,6 +86,14 @@ The JavaScript file size is quite huge(about 100kb gzipped) and therefore not su })(); ``` +If you are using modern JavaScript tooling, you can dynamically import it. + +```javascript +if (import.meta.env.MODE === 'development') { + import('eruda').then(eruda => eruda.default.init()); +} +``` + ## Configuration When initialization, a configuration object can be passed in.