Skip to content

Instantly share code, notes, and snippets.

@ssougnez
Last active July 17, 2018 19:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ssougnez/32dc4f1430bd84bf5844a8b013df1654 to your computer and use it in GitHub Desktop.
Save ssougnez/32dc4f1430bd84bf5844a8b013df1654 to your computer and use it in GitHub Desktop.
const path = require('path');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = {
mode: "development",
entry: {
adb: "./app/index.ts"
},
output: {
path: path.resolve(__dirname, "../AnotherDevBlog"),
filename: "Scripts/[name].min.js",
publicPath: "/"
},
resolve: {
extensions: ['.ts', '.js']
},
module: {
rules: [
{
test: /\.ts$/,
use: 'ts-loader',
exclude: /node_modules/
},
{
test: /\.html$/,
use: ['ngtemplate-loader', 'html-loader']
},
{
test: /\.css$/,
use: [MiniCssExtractPlugin.loader, "css-loader"]
},
{
test: /\.(jpe?g|png)$/,
use: "file-loader?name=img/[name].[ext]"
}
]
},
plugins: [
new MiniCssExtractPlugin({
filename: "css/[name].min.css"
})
],
optimization: {
splitChunks: {
cacheGroups: {
commons: {
test: /[\\/]node_modules[\\/]/,
name: "vendors",
chunks: "all"
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment