我尝试通过和 Webpack 3加载我的index.html
文件。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
夹?