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"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
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|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"
|
|
|
|
]
|
|
|
|
};
|