Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

213
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!