feat: Add jquery dependency

- Add jquery version 3.7.1
- Remove external script resource from app template
- Add eleventy passthrough to build/vendor
This commit is contained in:
sthag 2025-10-27 21:15:32 +01:00
parent c77bcd8bdc
commit ff5d4bd3eb
4 changed files with 14 additions and 2 deletions

View file

@ -40,6 +40,10 @@ module.exports = function (eleventyConfig) {
eleventyConfig.addPassthroughCopy("vendor");
eleventyConfig.addPassthroughCopy({"node_modules/bootstrap-icons": "vendor/bootstrap-icons"});
eleventyConfig.addPassthroughCopy({
"node_modules/jquery/dist/jquery.min.js": "vendor",
"node_modules/jquery/dist/jquery.min.map": "vendor"
});
// eleventyConfig.addPassthroughCopy({"node_modules/normalize.css/normalize.css": "vendor/normalize.css"});
eleventyConfig.addWatchTarget("./source/style/");

7
package-lock.json generated
View file

@ -11,6 +11,7 @@
"dependencies": {
"@11ty/eleventy": "^2.0.1",
"bootstrap-icons": "^1.13.1",
"jquery": "^3.7.1",
"sass": "^1.93.0"
},
"devDependencies": {
@ -1583,6 +1584,12 @@
"node": ">=10"
}
},
"node_modules/jquery": {
"version": "3.7.1",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz",
"integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==",
"license": "MIT"
},
"node_modules/js-stringify": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/js-stringify/-/js-stringify-1.0.2.tgz",

View file

@ -36,6 +36,7 @@
"dependencies": {
"@11ty/eleventy": "^2.0.1",
"bootstrap-icons": "^1.13.1",
"jquery": "^3.7.1",
"sass": "^1.93.0"
}
}

View file

@ -13,7 +13,7 @@
{% block script %}
{{ block.super -}}
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<script src="/vendor/jquery.min.js"></script>
<script src="{{ pageBase }}js/variables.js"></script>
<script src="{{ pageBase }}js/app.js"></script>