Extra <script> block in index.html gets deleted when compiled. How to Retain?
See original GitHub issueIf I add extra script within index.html
<body> it gets deleted when compiled:
How can I use the below code while having rollup rename main to main.hash.js
/ .jsc
without deleting it when compiled?
<script>
const fs = require('fs');
const bytenode = require('bytenode');
if (!fs.existsSync('./_assets/main.jsc')) {
bytenode.compileFile('./_assets/main.js', './_assets/main.jsc');
}
require('./_assets/main.jsc');
</script>
<!-- <script src="./_assets/main.jsc"></script> -->
vite
version: vite v1.0.0-rc.4- Operating System: Windows 10 Enterprise LTSC
- Node version: v12.18.2
- Optional:
- yarn version: 1.22.4
- Installed
vue
version (from `yarn.lock``) ^3.0.0-rc.5 - Installed
@vue/compiler-sfc
version ^3.0.0-rc.5
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:16 (3 by maintainers)
Top Results From Across the Web
How do I add certain script tags inside <head> and <body ...
It implies you want to add static script tags to your template. If that's the case you just need to go into your...
Read more >The Simplest Ways to Handle HTML Includes | CSS-Tricks
If you put that in a file called index.njk , you could process it with a simple Node script into index.html like this:...
Read more >Advanced Compilation | Closure Compiler - Google Developers
Compilation with ADVANCED_OPTIMIZATIONS achieves extra compression by being more aggressive in the ways that it transforms code and renames ...
Read more >Output Management - webpack
Setting up HtmlWebpackPlugin If you open index. html in your code editor, you'll see that the HtmlWebpackPlugin has created an entirely new file...
Read more >Chapter 1, Writing Your First JavaScript Program - O'Reilly
Still, JavaScript is more complex than either HTML or CSS, ... In many cases, you'll put the <script> tags in the page's <head>...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@underfin my personal need is to add a script for bytenode that will be compiled with electron but it seems that controlling how this gets compiled is something also needed in multiple other occasions. There is nothing special to reproduce. Just add the above within index.html and compile.
@cliqer did you occur some problem like
can not found module
on your app that appeared when build the electron app with vite and rollup when use some dependence base on nodejs?