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