Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

211
Visualizações
TypeScript code doesn't produce visual output to html

I try to build TypeScript code for html viewing, I have the following code: console.log('hello world'); After building code with "yarn build", "node ./node_modules/webpack/bin/webpack --mode development" run it with "node ./node_modules/webpack-dev-server/bin/webpack-dev-server --mode development " Also html file generated by builder is included in src directory and webpackbundle.js is also there:

<!DOCTYPE html> 
<html>
<head>
    <title>Canvas demo</title>
    <script defer src="webpackbundle.js"></script></head>
<body>
    <script src="webpackbundle.js"></script>
    <p id="clear">above</p>
</body>
</html>

But after running there is no expected output "hello world" on html, only "above" as stated as initial html, so it seems that app isn't viewed by running html

My webpack.config.js loks like:

var HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require("path");
module.exports = {
    mode: "development",
    devtool: "source-map",
    entry: './game.tsx',
    output: { 
        path : path.resolve(__dirname, 'src'),
        filename: 'webpackbundle.js'  
    }, 
    ...
    plugins: [new HtmlWebpackPlugin({
        path : path.resolve(__dirname, 'src'),
        template: "index.html",
        hash: true, // This is useful for cache busting
        filename: 'index.html'
    })]
}  //also have rules for typescript and resolve, port specification

In src webpackbundle.js.map is generated and webpackbundle.js has corresponding console.log('hello world') code, but there is no related output in html

Could anybody advise on how to make code output visible in html?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda