Created
June 12, 2018 14:58
-
-
Save ssougnez/4f70beebca0e9b955a0ea21e267744c2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
const HtmlWebpackPlugin = require("html-webpack-plugin"); | |
const CleanWebpackPlugin = require("clean-webpack-plugin"); | |
const MiniCssExtractPlugin = require("mini-css-extract-plugin"); | |
module.exports = { | |
entry: "./src/index.ts", | |
output: { | |
path: path.resolve(__dirname, "wwwroot"), | |
filename: "[name].[chunkhash].js", | |
publicPath: '/' | |
}, | |
resolve: { | |
extensions: [".js", ".ts", ".tsx"] | |
}, | |
module: { | |
rules: [ | |
{ | |
test: /\.tsx?$/, | |
use: "ts-loader" | |
}, | |
{ | |
test: /\.css$/, | |
use: [MiniCssExtractPlugin.loader, "css-loader"] | |
} | |
] | |
}, | |
plugins: [ | |
new CleanWebpackPlugin(["wwwroot"]), | |
new HtmlWebpackPlugin({ | |
template: "./src/index.html" | |
}), | |
new MiniCssExtractPlugin({ | |
filename: "css/[name].[chunkhash].css" | |
}) | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment