From dcad7cfff00f502200693fbc89eeed73bf6b4845 Mon Sep 17 00:00:00 2001 From: VKD Date: Sun, 22 Nov 2020 19:49:55 +0530 Subject: [PATCH 1/6] initial version added --- index.js | 39 ----------------------------- index.ts | 62 +++++++++++++++++++++++++++++++++++++++++++++++ package.json | 9 +++++-- tsconfig.json | 14 +++++++++++ webpack.common.js | 16 ++++++++++++ 5 files changed, 99 insertions(+), 41 deletions(-) delete mode 100644 index.js create mode 100644 index.ts create mode 100644 tsconfig.json diff --git a/index.js b/index.js deleted file mode 100644 index 47a3231..0000000 --- a/index.js +++ /dev/null @@ -1,39 +0,0 @@ -const path = require('path'); -const fs = require('fs'); -function mkdirs(dirpath) { - if (!fs.existsSync(path.dirname(dirpath))) { - mkdirs(path.dirname(dirpath)); - } - fs.mkdirSync(dirpath); -} - -class HTMLReport4Jest { - constructor(globalConfig, options) { - this._globalConfig = globalConfig; - this._options = options; - } - - onRunComplete(contexts, results) { - results.endTime = Date.now(); - results.reporterOptions = { ...this._options }; - const data = JSON.stringify(results); - const templatePath = path.resolve(__dirname, './dist/index.html'); - const htmlTemplate = fs.readFileSync(templatePath, 'utf-8'); - results.reporterOptions.title = results.reporterOptions.title - ? results.reporterOptions.title - : 'Jest Html Report'; - const outputContext = htmlTemplate - .replace('%RESULTDATA%', data) - .replace('%TITLE%', results.reporterOptions.title); - const publicPath = results.reporterOptions.reportPath - ? results.reporterOptions.reportPath - : './temp/'; - const filename = results.reporterOptions.reportFileName - ? results.reporterOptions.reportFileName - : 'result.html'; - fs.existsSync(publicPath) === false && publicPath && mkdirs(publicPath); - fs.writeFileSync(publicPath.concat(filename), outputContext, 'utf-8'); - } -} - -module.exports = HTMLReport4Jest; diff --git a/index.ts b/index.ts new file mode 100644 index 0000000..800c0d6 --- /dev/null +++ b/index.ts @@ -0,0 +1,62 @@ +const path = require('path'); +const fs = require('fs'); +import { AggregatedResult, TestResult } from '@jest/test-result'; +import { Circus, Config } from '@jest/types'; +import { Test, Context, ReporterOnStartOptions } from '@jest/reporters'; +function mkdirs(dirpath: string) { + if (!fs.existsSync(path.dirname(dirpath))) { + mkdirs(path.dirname(dirpath)); + } + fs.mkdirSync(dirpath); +} + +type HtmlReporter4JestOptions = { + title?: string; + reportPath?: string; + reportFileName?: string; +}; + +declare module '@jest/test-result' { + interface AggregatedResult { + endTime: number; + reporterOptions: HtmlReporter4JestOptions & Config.DefaultOptions; + } +} + +class HTMLReport4Jest { + private _globalConfig: Config.GlobalConfig; + private _options: Config.DefaultOptions; + + constructor( + globalConfig: Config.GlobalConfig, + options: Config.DefaultOptions, + ) { + this._globalConfig = globalConfig; + this._options = options; + } + + onRunComplete(context: Set, result: AggregatedResult) { + console.log(context); + result.endTime = Date.now(); + result.reporterOptions = { ...this._options }; + const data = JSON.stringify(result); + const templatePath = path.resolve(__dirname, './dist/index.html'); + const htmlTemplate = fs.readFileSync(templatePath, 'utf-8'); + result.reporterOptions.title = result.reporterOptions.title + ? result.reporterOptions.title + : 'Jest Html Report'; + const outputContext = htmlTemplate + .replace('%RESULTDATA%', data) + .replace('%TITLE%', result.reporterOptions.title); + const publicPath = result.reporterOptions.reportPath + ? result.reporterOptions.reportPath + : './temp/'; + const filename = result.reporterOptions.reportFileName + ? result.reporterOptions.reportFileName + : 'result.html'; + fs.existsSync(publicPath) === false && publicPath && mkdirs(publicPath); + fs.writeFileSync(publicPath.concat(filename), outputContext, 'utf-8'); + } +} + +module.exports = HTMLReport4Jest; diff --git a/package.json b/package.json index 30339de..0de79af 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,12 @@ "url": "https://github.com/vinothdevelop/HTMLReport4Jest/issues" }, "homepage": "https://vinothdevelop.github.io/HTMLReport4Jest/result.html", - "dependencies": {}, + "dependencies": { + "@jest/reporters": "^26.4.1", + "@jest/test-result": "^26.3.0", + "ts-loader": "^8.0.4", + "typescript": "^4.0.3" + }, "scripts": { "start": "webpack-dev-server --config webpack.development.config.js --open", "build": "webpack --config webpack.build.config.js --mode production", @@ -56,7 +61,7 @@ "@babel/core": "^7.10.4", "@babel/preset-env": "^7.10.4", "@babel/preset-react": "^7.10.4", - "@jest/types": "^26.1.0", + "@jest/types": "^26.3.0", "@testing-library/jest-dom": "^5.11.0", "@testing-library/react": "^11.0.0", "@types/react-dev-utils": "^9.0.4", diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..bb12aba --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "outDir": "./dist/", + "noImplicitAny": true, + "module": "commonjs", + "target": "es5", + "jsx": "react", + "allowJs": true, + "experimentalDecorators": true, + "types": ["jest"], + "typeRoots": ["../node_modules/@types"] + }, + "exclude": ["node_modules"] +} diff --git a/webpack.common.js b/webpack.common.js index 17283b7..3c687f0 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -3,6 +3,10 @@ const HtmlWebPackPlugin = require('html-webpack-plugin'); const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin'); const publicUrl = './public'; module.exports = { + entry: { + reporter: './index.ts', + main: './src/index.js', + }, module: { rules: [ { @@ -30,8 +34,20 @@ module.exports = { test: /\.css$/, use: ['style-loader', 'css-loader'], }, + { + test: /\.(ts|tsx)?$/, + use: 'ts-loader', + exclude: /node_modules/, + }, ], }, + resolve: { + extensions: ['.tsx', '.ts', '.js'], + }, + output: { + filename: '[name].js', + path: __dirname + '/dist', + }, plugins: [ new HtmlWebPackPlugin({ template: path.resolve('public/index.html'), From c6e7ad2702a556b6b4c10852c4de74e31cd96391 Mon Sep 17 00:00:00 2001 From: Vinothkumar Duraisamy Date: Sun, 22 Nov 2020 20:19:22 +0530 Subject: [PATCH 2/6] chore(deps) : Update webpack to v5 (#72) * chore(deps) : Update webpack to v5 * deprecation warnings resolved --- package.json | 12 ++++++------ webpack.build.config.js | 2 +- webpack.common.js | 4 ++++ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 30339de..73c3635 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "dependencies": {}, "scripts": { "start": "webpack-dev-server --config webpack.development.config.js --open", - "build": "webpack --config webpack.build.config.js --mode production", + "build": "webpack --config webpack.build.config.js", "test": "jest --silent", "lint": "eslint ." }, @@ -64,7 +64,7 @@ "babel-eslint": "^10.1.0", "babel-loader": "^8.1.0", "clean-webpack-plugin": "^3.0.0", - "css-loader": "^4.0.0", + "css-loader": "^5.0.1", "eslint": "^7.4.0", "eslint-config-prettier": "^6.11.0", "eslint-loader": "^4.0.2", @@ -72,7 +72,7 @@ "eslint-plugin-react": "^7.20.3", "eslint-plugin-react-hooks": "^4.0.8", "html-loader": "^1.1.0", - "html-webpack-plugin": "^4.3.0", + "html-webpack-plugin": "5.0.0-alpha.14", "identity-obj-proxy": "^3.0.0", "jest": "^26.1.0", "prettier": "^2.0.5", @@ -80,9 +80,9 @@ "react-dev-utils": "^10.2.1", "react-dom": "^16.13.1", "semantic-release": "^17.1.1", - "style-loader": "^1.2.1", - "webpack": "^4.43.0", - "webpack-cli": "^3.3.12", + "style-loader": "^2.0.0", + "webpack": "^5.6.0", + "webpack-cli": "^4.2.0", "webpack-dev-server": "^3.11.0", "webpack-merge": "^5.0.9" } diff --git a/webpack.build.config.js b/webpack.build.config.js index 8791a18..821655c 100644 --- a/webpack.build.config.js +++ b/webpack.build.config.js @@ -6,7 +6,7 @@ const HtmlWebPackPlugin = require('html-webpack-plugin'); module.exports = merge.merge(common, { mode: 'production', plugins: [ - new CleanWebpackPlugin(), + new CleanWebpackPlugin({}), new InlineChunkHtmlPlugin(HtmlWebPackPlugin, [/.*/]), ], }); diff --git a/webpack.common.js b/webpack.common.js index 17283b7..ae0dd11 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -3,6 +3,10 @@ const HtmlWebPackPlugin = require('html-webpack-plugin'); const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin'); const publicUrl = './public'; module.exports = { + output: { + path: path.resolve(process.cwd(), 'dist'), + publicPath: path.resolve(process.cwd(), 'dist'), + }, module: { rules: [ { From 690410262ad81ce5d8524e748a5b5d0880e74ac8 Mon Sep 17 00:00:00 2001 From: Vinothkumar Duraisamy Date: Sun, 22 Nov 2020 20:30:10 +0530 Subject: [PATCH 3/6] chore(deps): update react to v17 (#86) --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 73c3635..75c3767 100644 --- a/package.json +++ b/package.json @@ -76,9 +76,9 @@ "identity-obj-proxy": "^3.0.0", "jest": "^26.1.0", "prettier": "^2.0.5", - "react": "^16.13.1", - "react-dev-utils": "^10.2.1", - "react-dom": "^16.13.1", + "react": "^17.0.1", + "react-dev-utils": "^11.0.0", + "react-dom": "^17.0.1", "semantic-release": "^17.1.1", "style-loader": "^2.0.0", "webpack": "^5.6.0", From 966e2e632d78963d895a5b3f99e263e237d6012f Mon Sep 17 00:00:00 2001 From: Vinothkumar Duraisamy Date: Sun, 22 Nov 2020 22:05:33 +0530 Subject: [PATCH 4/6] fix: fixed start script (#87) --- package.json | 2 +- webpack.development.config.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 75c3767..4993769 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "homepage": "https://vinothdevelop.github.io/HTMLReport4Jest/result.html", "dependencies": {}, "scripts": { - "start": "webpack-dev-server --config webpack.development.config.js --open", + "start": "webpack serve --config webpack.development.config.js", "build": "webpack --config webpack.build.config.js", "test": "jest --silent", "lint": "eslint ." diff --git a/webpack.development.config.js b/webpack.development.config.js index 0cac413..b92325a 100644 --- a/webpack.development.config.js +++ b/webpack.development.config.js @@ -8,7 +8,7 @@ const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin'); module.exports = merge.merge(common, { output: { - publicPath: 'public/', + publicPath: '/', }, mode: 'development', devtool: 'inline-source-map', From eb0ce01f9bde3aca9939921b25ad8e91b0046d70 Mon Sep 17 00:00:00 2001 From: VKD Date: Sun, 22 Nov 2020 19:49:55 +0530 Subject: [PATCH 5/6] initial version added --- index.js | 39 ----------------------------- index.ts | 62 +++++++++++++++++++++++++++++++++++++++++++++++ package.json | 9 +++++-- tsconfig.json | 14 +++++++++++ webpack.common.js | 18 +++++++++++--- 5 files changed, 98 insertions(+), 44 deletions(-) delete mode 100644 index.js create mode 100644 index.ts create mode 100644 tsconfig.json diff --git a/index.js b/index.js deleted file mode 100644 index 47a3231..0000000 --- a/index.js +++ /dev/null @@ -1,39 +0,0 @@ -const path = require('path'); -const fs = require('fs'); -function mkdirs(dirpath) { - if (!fs.existsSync(path.dirname(dirpath))) { - mkdirs(path.dirname(dirpath)); - } - fs.mkdirSync(dirpath); -} - -class HTMLReport4Jest { - constructor(globalConfig, options) { - this._globalConfig = globalConfig; - this._options = options; - } - - onRunComplete(contexts, results) { - results.endTime = Date.now(); - results.reporterOptions = { ...this._options }; - const data = JSON.stringify(results); - const templatePath = path.resolve(__dirname, './dist/index.html'); - const htmlTemplate = fs.readFileSync(templatePath, 'utf-8'); - results.reporterOptions.title = results.reporterOptions.title - ? results.reporterOptions.title - : 'Jest Html Report'; - const outputContext = htmlTemplate - .replace('%RESULTDATA%', data) - .replace('%TITLE%', results.reporterOptions.title); - const publicPath = results.reporterOptions.reportPath - ? results.reporterOptions.reportPath - : './temp/'; - const filename = results.reporterOptions.reportFileName - ? results.reporterOptions.reportFileName - : 'result.html'; - fs.existsSync(publicPath) === false && publicPath && mkdirs(publicPath); - fs.writeFileSync(publicPath.concat(filename), outputContext, 'utf-8'); - } -} - -module.exports = HTMLReport4Jest; diff --git a/index.ts b/index.ts new file mode 100644 index 0000000..800c0d6 --- /dev/null +++ b/index.ts @@ -0,0 +1,62 @@ +const path = require('path'); +const fs = require('fs'); +import { AggregatedResult, TestResult } from '@jest/test-result'; +import { Circus, Config } from '@jest/types'; +import { Test, Context, ReporterOnStartOptions } from '@jest/reporters'; +function mkdirs(dirpath: string) { + if (!fs.existsSync(path.dirname(dirpath))) { + mkdirs(path.dirname(dirpath)); + } + fs.mkdirSync(dirpath); +} + +type HtmlReporter4JestOptions = { + title?: string; + reportPath?: string; + reportFileName?: string; +}; + +declare module '@jest/test-result' { + interface AggregatedResult { + endTime: number; + reporterOptions: HtmlReporter4JestOptions & Config.DefaultOptions; + } +} + +class HTMLReport4Jest { + private _globalConfig: Config.GlobalConfig; + private _options: Config.DefaultOptions; + + constructor( + globalConfig: Config.GlobalConfig, + options: Config.DefaultOptions, + ) { + this._globalConfig = globalConfig; + this._options = options; + } + + onRunComplete(context: Set, result: AggregatedResult) { + console.log(context); + result.endTime = Date.now(); + result.reporterOptions = { ...this._options }; + const data = JSON.stringify(result); + const templatePath = path.resolve(__dirname, './dist/index.html'); + const htmlTemplate = fs.readFileSync(templatePath, 'utf-8'); + result.reporterOptions.title = result.reporterOptions.title + ? result.reporterOptions.title + : 'Jest Html Report'; + const outputContext = htmlTemplate + .replace('%RESULTDATA%', data) + .replace('%TITLE%', result.reporterOptions.title); + const publicPath = result.reporterOptions.reportPath + ? result.reporterOptions.reportPath + : './temp/'; + const filename = result.reporterOptions.reportFileName + ? result.reporterOptions.reportFileName + : 'result.html'; + fs.existsSync(publicPath) === false && publicPath && mkdirs(publicPath); + fs.writeFileSync(publicPath.concat(filename), outputContext, 'utf-8'); + } +} + +module.exports = HTMLReport4Jest; diff --git a/package.json b/package.json index 4993769..b3de203 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,12 @@ "url": "https://github.com/vinothdevelop/HTMLReport4Jest/issues" }, "homepage": "https://vinothdevelop.github.io/HTMLReport4Jest/result.html", - "dependencies": {}, + "dependencies": { + "@jest/reporters": "^26.4.1", + "@jest/test-result": "^26.3.0", + "ts-loader": "^8.0.4", + "typescript": "^4.0.3" + }, "scripts": { "start": "webpack serve --config webpack.development.config.js", "build": "webpack --config webpack.build.config.js", @@ -56,7 +61,7 @@ "@babel/core": "^7.10.4", "@babel/preset-env": "^7.10.4", "@babel/preset-react": "^7.10.4", - "@jest/types": "^26.1.0", + "@jest/types": "^26.3.0", "@testing-library/jest-dom": "^5.11.0", "@testing-library/react": "^11.0.0", "@types/react-dev-utils": "^9.0.4", diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..bb12aba --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "outDir": "./dist/", + "noImplicitAny": true, + "module": "commonjs", + "target": "es5", + "jsx": "react", + "allowJs": true, + "experimentalDecorators": true, + "types": ["jest"], + "typeRoots": ["../node_modules/@types"] + }, + "exclude": ["node_modules"] +} diff --git a/webpack.common.js b/webpack.common.js index ae0dd11..3c687f0 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -3,9 +3,9 @@ const HtmlWebPackPlugin = require('html-webpack-plugin'); const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin'); const publicUrl = './public'; module.exports = { - output: { - path: path.resolve(process.cwd(), 'dist'), - publicPath: path.resolve(process.cwd(), 'dist'), + entry: { + reporter: './index.ts', + main: './src/index.js', }, module: { rules: [ @@ -34,8 +34,20 @@ module.exports = { test: /\.css$/, use: ['style-loader', 'css-loader'], }, + { + test: /\.(ts|tsx)?$/, + use: 'ts-loader', + exclude: /node_modules/, + }, ], }, + resolve: { + extensions: ['.tsx', '.ts', '.js'], + }, + output: { + filename: '[name].js', + path: __dirname + '/dist', + }, plugins: [ new HtmlWebPackPlugin({ template: path.resolve('public/index.html'), From b61b145a16e93fb1fdf18ad68d4ca5e3bd4574a4 Mon Sep 17 00:00:00 2001 From: VKD Date: Mon, 23 Nov 2020 22:05:46 +0530 Subject: [PATCH 6/6] fixed combilation issues --- index.ts | 7 +++---- jest.config.js | 2 +- package.json | 18 +++++++++++------- tsconfig.json | 13 ++++++++----- webpack.common.js | 17 ++--------------- 5 files changed, 25 insertions(+), 32 deletions(-) diff --git a/index.ts b/index.ts index 800c0d6..e674d67 100644 --- a/index.ts +++ b/index.ts @@ -1,5 +1,5 @@ -const path = require('path'); -const fs = require('fs'); +import * as path from 'path'; +import * as fs from 'fs'; import { AggregatedResult, TestResult } from '@jest/test-result'; import { Circus, Config } from '@jest/types'; import { Test, Context, ReporterOnStartOptions } from '@jest/reporters'; @@ -36,11 +36,10 @@ class HTMLReport4Jest { } onRunComplete(context: Set, result: AggregatedResult) { - console.log(context); result.endTime = Date.now(); result.reporterOptions = { ...this._options }; const data = JSON.stringify(result); - const templatePath = path.resolve(__dirname, './dist/index.html'); + const templatePath = path.resolve(__dirname, './index.html'); const htmlTemplate = fs.readFileSync(templatePath, 'utf-8'); result.reporterOptions.title = result.reporterOptions.title ? result.reporterOptions.title diff --git a/jest.config.js b/jest.config.js index 012db12..b0108e1 100644 --- a/jest.config.js +++ b/jest.config.js @@ -2,7 +2,7 @@ module.exports = { reporters: [ 'default', [ - '/index.js', + '/dist/index.js', { title: 'Test Report', expandResults: true, diff --git a/package.json b/package.json index b3de203..e57ec18 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "htmlreport4jest", "version": "0.5.0-semantically-released", "description": "Html report for jest", + "main": "dist/index.js", "keywords": [ "jest", "jest report", @@ -26,14 +27,11 @@ }, "homepage": "https://vinothdevelop.github.io/HTMLReport4Jest/result.html", "dependencies": { - "@jest/reporters": "^26.4.1", - "@jest/test-result": "^26.3.0", - "ts-loader": "^8.0.4", - "typescript": "^4.0.3" }, "scripts": { + "build:index": "yarn tsc -p .", "start": "webpack serve --config webpack.development.config.js", - "build": "webpack --config webpack.build.config.js", + "build": "webpack --config webpack.build.config.js && yarn build:index", "test": "jest --silent", "lint": "eslint ." }, @@ -41,10 +39,11 @@ "extends": "react-app" }, "files": [ - "index.js", + "dist/index.js", "readme.md", "dist/index.html" ], + "types": "./dir/index.d.ts", "browserslist": { "production": [ ">0.2%", @@ -62,8 +61,11 @@ "@babel/preset-env": "^7.10.4", "@babel/preset-react": "^7.10.4", "@jest/types": "^26.3.0", + "@jest/reporters": "^26.4.1", + "@jest/test-result": "^26.3.0", "@testing-library/jest-dom": "^5.11.0", "@testing-library/react": "^11.0.0", + "@types/node": "^14.14.9", "@types/react-dev-utils": "^9.0.4", "ansi-to-html": "^0.6.14", "babel-eslint": "^10.1.0", @@ -77,7 +79,7 @@ "eslint-plugin-react": "^7.20.3", "eslint-plugin-react-hooks": "^4.0.8", "html-loader": "^1.1.0", - "html-webpack-plugin": "5.0.0-alpha.14", + "html-webpack-plugin": "^5.0.0-alpha.14", "identity-obj-proxy": "^3.0.0", "jest": "^26.1.0", "prettier": "^2.0.5", @@ -86,6 +88,8 @@ "react-dom": "^17.0.1", "semantic-release": "^17.1.1", "style-loader": "^2.0.0", + "ts-loader": "^8.0.4", + "typescript": "^4.1.2", "webpack": "^5.6.0", "webpack-cli": "^4.2.0", "webpack-dev-server": "^3.11.0", diff --git a/tsconfig.json b/tsconfig.json index bb12aba..8ba04c7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,12 +3,15 @@ "outDir": "./dist/", "noImplicitAny": true, "module": "commonjs", - "target": "es5", - "jsx": "react", + "target": "ES5", "allowJs": true, "experimentalDecorators": true, - "types": ["jest"], - "typeRoots": ["../node_modules/@types"] + "typeRoots": ["../node_modules/@types"], + "sourceMap": true, + "declaration": true, + "declarationDir": "./dist/" }, - "exclude": ["node_modules"] + "exclude": ["node_modules"], + "files": ["index.ts"], + "include": ["index.ts"] } diff --git a/webpack.common.js b/webpack.common.js index 3c687f0..9678fe9 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -3,9 +3,8 @@ const HtmlWebPackPlugin = require('html-webpack-plugin'); const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin'); const publicUrl = './public'; module.exports = { - entry: { - reporter: './index.ts', - main: './src/index.js', + output: { + path: path.resolve(process.cwd(), 'dist'), }, module: { rules: [ @@ -34,20 +33,8 @@ module.exports = { test: /\.css$/, use: ['style-loader', 'css-loader'], }, - { - test: /\.(ts|tsx)?$/, - use: 'ts-loader', - exclude: /node_modules/, - }, ], }, - resolve: { - extensions: ['.tsx', '.ts', '.js'], - }, - output: { - filename: '[name].js', - path: __dirname + '/dist', - }, plugins: [ new HtmlWebPackPlugin({ template: path.resolve('public/index.html'),