Skip to content

dpikt/modulepreload

Folders and files

NameName
Last commit message
Last commit date

Latest commit

d6966a0 · Dec 23, 2023

History

7 Commits
Dec 23, 2023
Dec 23, 2023
Dec 13, 2023
Dec 23, 2023
Dec 13, 2023
Dec 13, 2023
Dec 13, 2023
Dec 23, 2023

Repository files navigation

modulepreload

Inject modulepreload tags into HTML.

$ npm install --save-dev modulepreload
$ npx modulepreload inject -w index.html

Before injection:

<!-- index.html -->
<html>
<head>
    <title>Example</title>
</head>
<body>
    <script type="module">
        import './dep.js'; // imports ./another-dep.js
    </script>
</body>
</html>

After injection:

<!-- index.html -->
<html>
<head>
    <title>Example</title>
    <link rel="modulepreload" href="/dep.js" />
    <link rel="modulepreload" href="/another-dep.js" />
</head>
<body>
    <script type="module">
        import './dep.js'; // imports ./another-dep.js
    </script>
</body>
</html>

About

Inject modulepreload tags into HTML.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published