webpack.config.js file
const path = require("path");
const webpack = require("webpack");
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const checkerPlugin = require("awesome-typescript-loader").CheckerPlugin;
module.exports = () => {
return [{
mode: "development",
entry: {
app: "./src/index.tsx",
vendor: ["react", "react-dom", "antd"]
},
output: {
path: path.resolve(__dirname, "./wwwroot/dist"),
filename: "[name].js",
publicPath: "dist/"
},
module: {
rules: [
{
test: /\.tsx?$/, include: "/src/", use: "awesome-typescript-loader?silent=true"
}, {
test: /\.css$/,
loader: ExtractTextPlugin.extract({
fallback: "style-loader",
use: ["css-loader"]
})
}, {
test: /\.less$/,
loader: ExtractTextPlugin.extract({
fallback: "style-loader",
use: ["css-loader", "less-loader"]
})
},
{ test: /\.(png|woff|woff2|eot|ttf|svg)(\?|$)/, use: "file-loader?limit=100000" },
{ test: /\.(png|jpg|jpeg|gif|svg)$/, use: "file-loader?limit=25000" }
]
},
resolve: {
extensions: [".js", ".jsx", ".ts", ".tsx"]
},
externals: {
"react": "React",
"react-dom": "ReactDOM",
"antd": "Antd"
},
plugins: [
new checkerPlugin()
]
}];
};