Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a3f31c9

Browse files
committed
Update webpack configs
1 parent 7b5e982 commit a3f31c9

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

site/webpack.common.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* be shared between development and production.
44
*/
55

6-
76
import * as path from "path"
87
import { Configuration } from "webpack"
98
import HtmlWebpackPlugin from "html-webpack-plugin"
@@ -17,7 +16,7 @@ const plugins = [
1716
title: "Custom template",
1817
template: path.join(templatePath, "index.html"),
1918
inject: "body",
20-
})
19+
}),
2120
]
2221

2322
export const commonWebpackConfig: Configuration = {
@@ -41,7 +40,7 @@ export const commonWebpackConfig: Configuration = {
4140
resolve: {
4241
// Let webpack know to consider ts/tsx files for bundling
4342
// See: https://webpack.js.org/guides/typescript/
44-
extensions: [".tsx", ".ts", ".js"]
43+
extensions: [".tsx", ".ts", ".js"],
4544
},
4645

4746
// output defines the name and location of the final bundle
@@ -53,5 +52,8 @@ export const commonWebpackConfig: Configuration = {
5352
filename: "bundle.[contenthash].js",
5453
path: path.resolve(__dirname, "out"),
5554
},
55+
56+
plugins: plugins,
57+
5658
target: "web",
57-
}
59+
}

site/webpack.dev.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ const config: Configuration = {
4747
// properly serving index.html on 404s.
4848
historyApiFallback: true,
4949
hot: true,
50+
port: 8080,
5051
proxy: {
5152
"/api": "http://localhost:3000",
5253
},

site/webpack.prod.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ export const config: Configuration = {
2424
// files to the 'out' folder.
2525
new CopyWebpackPlugin({
2626
patterns: [{ from: "static", to: "." }],
27-
})
28-
]
27+
}),
28+
],
2929
}
3030

3131
export default config

0 commit comments

Comments
 (0)