Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where can I add attributes to the generated script tags before building my Vue app?

I want to add attributes to the script tags that are generated when my Webpack Vue app is build. I can't seem to find the file where I can add them before building the script so they always get added on building my app.

Are these options present?

Thanks!

This is my index file after build right now:

<!DOCTYPE html>
<html>

<head>
<meta charset=utf-8>
<meta name=viewport content="width=device-width,initial-scale=1">
<title>nes_b2c_koffieplein_anchor-nav</title>
<link href=./static/css/app.bfaa53c28fee7adbfa6730ae0381661b.css 
rel=stylesheet>
</head>

<body>
<div id=achor-links></div>
<script type=text/javascript 
src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script>
<script type=text/javascript 
src=./static/js/vendor.a73abbfdb077dea7910a.js></script>
<script type=text/javascript 
src=./static/js/app.77c072c52113ea3ac052.js></script>
</body>

</html>

Where are these scripts generated within my Vue files?

like image 244
InPixel Avatar asked Nov 30 '25 19:11

InPixel


1 Answers

I dowloaded https://github.com/jantimon/html-webpack-plugin and https://www.npmjs.com/package/script-ext-html-webpack-plugin.

Followed the documentation and got it working.

like image 92
InPixel Avatar answered Dec 02 '25 10:12

InPixel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!