최원석3 [goesnow]

add bundles

This diff is collapsed. Click to expand it.
...@@ -23,9 +23,11 @@ ...@@ -23,9 +23,11 @@
23 }, 23 },
24 "devDependencies": { 24 "devDependencies": {
25 "@types/node": "^14.11.2", 25 "@types/node": "^14.11.2",
26 + "clean-webpack-plugin": "^3.0.0",
26 "css-loader": "^5.1.1", 27 "css-loader": "^5.1.1",
27 "file-loader": "^6.2.0", 28 "file-loader": "^6.2.0",
28 "gts": "^3.1.0", 29 "gts": "^3.1.0",
30 + "html-webpack-plugin": "^5.3.0",
29 "style-loader": "^2.0.0", 31 "style-loader": "^2.0.0",
30 "ts-loader": "^8.0.17", 32 "ts-loader": "^8.0.17",
31 "typescript": "^4.0.3", 33 "typescript": "^4.0.3",
......
This diff is collapsed. Click to expand it.
...@@ -6,6 +6,5 @@ ...@@ -6,6 +6,5 @@
6 </head> 6 </head>
7 <body> 7 <body>
8 <div id="App"></div> 8 <div id="App"></div>
9 - <script type="module" src="public/main.js" ></script>
10 </body> 9 </body>
11 </html> 10 </html>
...\ No newline at end of file ...\ No newline at end of file
......
1 -const path = require('path') 1 +const path = require('path');
2 +const { CleanWebpackPlugin } = require('clean-webpack-plugin');
3 +const HtmlWebpackPlugin = require('html-webpack-plugin')
2 4
3 module.exports = { 5 module.exports = {
4 mode : 'development', 6 mode : 'development',
...@@ -30,17 +32,23 @@ module.exports = { ...@@ -30,17 +32,23 @@ module.exports = {
30 extensions: [".tsx", ".ts", ".js"], 32 extensions: [".tsx", ".ts", ".js"],
31 }, 33 },
32 output : { 34 output : {
33 - publicPath: '/app', 35 + publicPath: '/app/public',
34 path: path.resolve('./public'), 36 path: path.resolve('./public'),
35 filename: '[name].js', 37 filename: '[name].js',
36 }, 38 },
37 devServer : { 39 devServer : {
38 port : 3000, 40 port : 3000,
39 hot: true, 41 hot: true,
40 - contentBase: __dirname, 42 + contentBase: __dirname + '/public/',
41 inline: true, 43 inline: true,
42 watchOptions: { 44 watchOptions: {
43 poll: true 45 poll: true
44 } 46 }
45 - } 47 + },
48 + plugins : [
49 + new CleanWebpackPlugin(),
50 + new HtmlWebpackPlugin({
51 + template : './src/index.html'
52 + })
53 + ]
46 } 54 }
...\ No newline at end of file ...\ No newline at end of file
......