You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.1 KiB
40 lines
1.1 KiB
8 years ago
|
const path = require("path");
|
||
|
const webpack = require("webpack");
|
||
|
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
||
|
|
||
|
module.exports = {
|
||
8 years ago
|
entry: [
|
||
|
"react-hot-loader/patch",
|
||
8 years ago
|
"webpack-dev-server/client?http://localhost:8080",
|
||
|
"webpack/hot/only-dev-server",
|
||
8 years ago
|
"./app/script/index.tsx"
|
||
|
],
|
||
8 years ago
|
devtool: "inline-source-map",
|
||
8 years ago
|
output: {
|
||
8 years ago
|
path: path.resolve(__dirname, "build"),
|
||
8 years ago
|
filename: "bundle.js"
|
||
|
},
|
||
|
resolve: {
|
||
|
extensions: [".ts", ".tsx", ".js"],
|
||
|
alias: {
|
||
|
app: path.resolve("./app")
|
||
|
}
|
||
|
},
|
||
|
module: {
|
||
|
rules: [
|
||
8 years ago
|
{ test: /\.tsx?$/, loaders: ["react-hot-loader/webpack", "awesome-typescript-loader"] },
|
||
8 years ago
|
{ test: /\.css$/, loader: "style-loader!css-loader" },
|
||
|
{ test: /\.(ttf|eot|svg|woff(2)?|png|jpg)(\?[a-z0-9=&.]+)?$/, loader: "file-loader" }
|
||
|
]
|
||
|
},
|
||
|
plugins: [
|
||
|
new HtmlWebpackPlugin({
|
||
8 years ago
|
template: "./app/index.html"
|
||
8 years ago
|
}),
|
||
|
new webpack.NamedModulesPlugin(),
|
||
|
new webpack.HotModuleReplacementPlugin()
|
||
|
],
|
||
|
devServer: {
|
||
8 years ago
|
hot: true
|
||
8 years ago
|
}
|
||
8 years ago
|
};
|