Change bundle link for dev server

This commit is contained in:
Nick Playfair 2025-06-11 14:39:20 +01:00
parent 21296a9b0d
commit 59c5f71768
2 changed files with 22 additions and 11 deletions

View File

@ -30,6 +30,6 @@
<pre id="partsHTML"></pre>
</section>
</main>
<script src="dist/bundle.js"></script>
<script src="bundle.js"></script>
</body>
</html>

View File

@ -1,28 +1,39 @@
const path = require("path");
const path = require('path');
const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
mode: "development",
entry: "./src/index.ts",
devtool: "inline-source-map",
mode: 'development',
entry: './src/index.ts',
devtool: 'inline-source-map',
devServer: {
static: {
directory: path.join(__dirname, "./"),
directory: path.join(__dirname, './'),
},
},
module: {
rules: [
{
test: /\.tsx?$/,
use: "ts-loader",
use: 'ts-loader',
exclude: /node_modules/,
},
],
},
resolve: {
extensions: [".tsx", ".ts", ".js"],
extensions: ['.tsx', '.ts', '.js'],
},
output: {
filename: "bundle.js",
path: path.resolve(__dirname, "dist"),
publicPath: "/dist",
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist'),
publicPath: '/dist',
},
plugins: [
new CopyWebpackPlugin({
patterns: [
{
from: 'html/**/*',
to: '[name][ext]',
},
],
}),
],
};