我尝试通过index.html
和Webpack 3加载我的file-loader
文件。
我的webpack.config.ts
看起来像这样:
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;
不幸的是,它并没有将src/index.html
文件加载到dist
文件夹。我究竟做错了什么?如何从src
文件夹获取索引文件到dist
文件夹?