Attempting to utilize the file-loader
and Webpack 3 to load my index.html
file is proving to be a challenge.
The configuration in my webpack.config.ts
file appears as follows:
import * as webpack from 'webpack';
const config: webpack.Configuration = {
entry: "./src/app.tsx",
output: {
filename: "bundle.js",
path: __dirname + "/dist"
},
devtool: "source-map",
resolve: {
extensions: [".webpack.js", ".web.js", ".ts", ".tsx", ".js", ".html"]
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: "awesome-typescript-loader"
}, {
test: /\.html$/,
loader: "file-loader"
}
]
}
};
export default config;
Regrettably, the src/index.html
file is not being loaded into the dist
folder. What error am I making here? How can I successfully transfer the index file from the src
directory to the dist
folder?