Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

218
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda