Change bundle link for dev server
This commit is contained in:
parent
21296a9b0d
commit
59c5f71768
@ -30,6 +30,6 @@
|
|||||||
<pre id="partsHTML"></pre>
|
<pre id="partsHTML"></pre>
|
||||||
</section>
|
</section>
|
||||||
</main>
|
</main>
|
||||||
<script src="dist/bundle.js"></script>
|
<script src="bundle.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -1,28 +1,39 @@
|
|||||||
const path = require("path");
|
const path = require('path');
|
||||||
|
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||||
module.exports = {
|
module.exports = {
|
||||||
mode: "development",
|
mode: 'development',
|
||||||
entry: "./src/index.ts",
|
entry: './src/index.ts',
|
||||||
devtool: "inline-source-map",
|
devtool: 'inline-source-map',
|
||||||
devServer: {
|
devServer: {
|
||||||
static: {
|
static: {
|
||||||
directory: path.join(__dirname, "./"),
|
directory: path.join(__dirname, './'),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
test: /\.tsx?$/,
|
test: /\.tsx?$/,
|
||||||
use: "ts-loader",
|
use: 'ts-loader',
|
||||||
exclude: /node_modules/,
|
exclude: /node_modules/,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
extensions: [".tsx", ".ts", ".js"],
|
extensions: ['.tsx', '.ts', '.js'],
|
||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
filename: "bundle.js",
|
filename: 'bundle.js',
|
||||||
path: path.resolve(__dirname, "dist"),
|
path: path.resolve(__dirname, 'dist'),
|
||||||
publicPath: "/dist",
|
publicPath: '/dist',
|
||||||
},
|
},
|
||||||
|
plugins: [
|
||||||
|
new CopyWebpackPlugin({
|
||||||
|
patterns: [
|
||||||
|
{
|
||||||
|
from: 'html/**/*',
|
||||||
|
to: '[name][ext]',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}),
|
||||||
|
],
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user