As you cannot expect cmd.exe to run powershell.exe commands without telling cmd to use powershell for them, here's an answer based upon that:
@If Not Exist "www\index.html" (GoTo :EOF)Else CD "www"
@Echo(
@Echo Replacing instances of 'type="module"' in index.html with 'type="text/javascript"'.
@"%__AppDir__%WindowsPowerShell\v1.0\powershell.exe" -NoProfile -Command "(Get-Content -Path 'index.html') -Replace 'type=\"module\"', 'type=\"text/javascript\"' | Set-Content -Path 'index.html'"
The powershell command line itself could also be shortened a little, if necessary:
@PowerShell -NoP "(GC 'index.html') -Replace 'type=\"module\"','type=\"text/javascript\"'|SC 'index.html'"
The above example assumes that the location of your installed PowerShell executable is the current directory, or one of those listed under %PATH%, and if not in the current directory, there is no extensionless file named powershell in the current directory or one with an extension listed under %PATHEXT%.
If you wanted to use the .Replace syntax, which requires at least powershell-3.0 it is effectively the same method:
@PowerShell -NoP "(GC 'index.html').Replace('type=\"module\"','type=\"text/javascript\"')|SC 'index.html'"
However, if you're using powershell-3.0+, you may find that it's more efficient using the -Raw option with Get-Content:
@PowerShell -NoP "(GC 'index.html' -Raw).Replace('type=\"module\"','type=\"text/javascript\"')|SC 'index.html'"
The answers above are performing a search for the string, type="module" and replacing it with type="text/javascript". If you wish to use something less robust/more simple, like replacing module with javascript, then use -Replace 'module','javascript', or .Replace('module','javascript') instead.
Should you be aware that your html file is, for instance, UTF-8 encoded, you could maintain that encoding by stipulating it as further options to Get-Content and Set-Content.
Any PowerShell version:
@"%__AppDir__%WindowsPowerShell\v1.0\powershell.exe" -NoProfile -Command "(Get-Content -Path 'index.html' -Encoding UTF8) -Replace 'type=\"module\"', 'type=\"text/javascript\"' | Set-Content -Path 'index.html' -Encoding UTF8"
…and shortened:
@PowerShell -NoP "(GC 'index.html' -En UTF8) -Replace 'type=\"module\"','type=\"text/javascript\"'|SC 'index.html' -En UTF8"
PowerShell version 3+:
@"%__AppDir__%WindowsPowerShell\v1.0\powershell.exe" -NoProfile -Command "(Get-Content -Path 'index.html' -Encoding UTF8 -Raw).Replace('type=\"module\"', 'type=\"text/javascript\"') | Set-Content -Path 'index.html' -Encoding UTF8"
…and shortened:
@PowerShell -NoP "(GC 'index.html' -En UTF8 -Ra).Replace('type=\"module\"','type=\"text/javascript\"')|SC 'index.html' -En UTF8"