48 lines
985 B
JavaScript
48 lines
985 B
JavaScript
const path = require("path");
|
|
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
|
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
|
|
|
|
module.exports = {
|
|
mode: "development",
|
|
devtool: "inline-source-map",
|
|
plugins: [
|
|
new CleanWebpackPlugin(),
|
|
new HtmlWebpackPlugin({
|
|
hash: true,
|
|
xhtml: true,
|
|
template: "./src/index.html"
|
|
})
|
|
],
|
|
entry: {
|
|
index: "./src/ts/index.ts"
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.s[ac]ss$/i,
|
|
use: ["style-loader", "css-loader", "sass-loader"]
|
|
},
|
|
{
|
|
test: /\.tsx?$/,
|
|
use: "ts-loader",
|
|
exclude: /node_modules/
|
|
},
|
|
{
|
|
test: /\.(png|svg|jpe?g|gif)$/,
|
|
use: {
|
|
loader: "file-loader",
|
|
query: {
|
|
outputPath: "images"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
resolve: {
|
|
extensions: [".ts"]
|
|
},
|
|
output: {
|
|
filename: "[name].bundle.js",
|
|
path: path.resolve(__dirname, "dist")
|
|
}
|
|
};
|