erratic-gate/webpack.config.js

67 lines
1.6 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-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"
}
]
},
{
test: /\.(png|mp3|wav)$/,
use: [
{
loader: 'file-loader',
options: {}
}
]
},
{
test: /\.(scss|sass)$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: ['css-loader', 'sass-loader']
})
},
{
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"
]
};