erratic-gate/webpack.config.js

83 lines
2.1 KiB
JavaScript
Raw Normal View History

2019-03-06 09:25:58 +01:00
const HtmlWebPackPlugin = require("html-webpack-plugin");
const ExtractTextPlugin = require('extract-text-webpack-plugin');
2019-06-02 22:32:30 +02:00
const TerserPlugin = require('terser-webpack-plugin');
2019-05-27 19:29:29 +02:00
2019-03-06 09:25:58 +01:00
module.exports = {
devtool: 'inline-source-map',
module: {
rules: [
{
test: /\.ts$/,
use: 'ts-loader',
exclude: /node_modules/
},
{
test: /\.html$/,
use: [
{
loader: "html-loader"
}
]
},
{
2019-05-28 17:26:14 +02:00
test: /\.(png|jpg|mp3|wav)$/,
2019-03-06 09:25:58 +01:00
use: [
{
loader: 'file-loader',
options: {}
}
]
},
{
test: /\.scss$/,
use: [
{
loader: 'file-loader',
options: {
name: 'style.css',
},
},
{ loader: 'extract-loader' },
{ loader: 'css-loader' },
{
loader: 'sass-loader',
options: {
includePaths: ['./node_modules']
}
},
]
2019-03-06 09:25:58 +01:00
},
{
test: /\.(eot|svg|ttf|woff|woff2)$/,
use: {
loader: 'file-loader?name=./res/fonts/[name].[ext]'
}
}
]
},
plugins: [
new HtmlWebPackPlugin({
template: "./src/index.html",
filename: "./index.html"
}),
new ExtractTextPlugin(
{
filename: 'style.css',
allChunks: true
}
)
],
resolve: {
extensions: [
".js",
".ts"
]
},
entry: [
"./src/index.ts"
2019-06-02 22:32:30 +02:00
],
optimization: {
minimizer: [new TerserPlugin()],
}
2019-03-06 09:25:58 +01:00
};