2020-03-30 12:19:54 +02:00
|
|
|
var theme = '../themes/MetroMumbleLight'
|
2020-03-30 10:36:57 +02:00
|
|
|
var path = require('path');
|
2016-11-27 17:43:59 +01:00
|
|
|
|
|
|
|
module.exports = {
|
2021-03-11 10:39:09 +01:00
|
|
|
mode: 'production',
|
2018-09-23 17:10:11 +02:00
|
|
|
entry: {
|
|
|
|
index: [
|
|
|
|
'./app/index.js',
|
|
|
|
'./app/index.html'
|
|
|
|
],
|
2020-03-30 12:30:07 +02:00
|
|
|
config: './app/config.js',
|
|
|
|
theme: './app/theme.js',
|
|
|
|
matrix: './app/matrix.js'
|
2018-09-23 17:10:11 +02:00
|
|
|
},
|
2020-04-03 12:29:27 +02:00
|
|
|
devServer: {
|
|
|
|
contentBase: './dist',
|
|
|
|
hot: true
|
|
|
|
},
|
2020-03-31 16:05:14 +02:00
|
|
|
devtool: "cheap-source-map",
|
2016-11-27 17:43:59 +01:00
|
|
|
output: {
|
2020-03-30 10:36:57 +02:00
|
|
|
path: path.join(__dirname, 'dist'),
|
2020-05-03 17:25:02 +02:00
|
|
|
chunkFilename: '[chunkhash].js',
|
2020-03-30 10:36:57 +02:00
|
|
|
filename: '[name].js'
|
2016-11-27 17:43:59 +01:00
|
|
|
},
|
|
|
|
module: {
|
2020-03-30 10:36:57 +02:00
|
|
|
rules: [
|
2016-11-27 17:43:59 +01:00
|
|
|
{
|
|
|
|
test: /\.js$/,
|
|
|
|
exclude: /node_modules/,
|
2020-03-30 10:36:57 +02:00
|
|
|
use: {
|
|
|
|
loader: 'babel-loader',
|
|
|
|
options: {
|
|
|
|
presets: ['@babel/preset-env'],
|
|
|
|
plugins: ['@babel/plugin-transform-runtime']
|
|
|
|
}
|
2016-11-27 17:43:59 +01:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.html$/,
|
2020-03-30 10:36:57 +02:00
|
|
|
use: [
|
2020-03-30 12:19:54 +02:00
|
|
|
{
|
|
|
|
loader: 'file-loader',
|
|
|
|
options: { 'name': '[name].[ext]' }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
loader: "extract-loader"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
loader: 'html-loader',
|
|
|
|
options: {
|
|
|
|
attrs: ['img:src', 'link:href'],
|
|
|
|
root: theme
|
|
|
|
}
|
|
|
|
}
|
2016-11-27 17:43:59 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.css$/,
|
2020-03-30 10:36:57 +02:00
|
|
|
use: [
|
2016-11-27 17:43:59 +01:00
|
|
|
'file-loader',
|
|
|
|
'extract-loader',
|
|
|
|
'css-loader'
|
|
|
|
]
|
|
|
|
},
|
2020-03-30 12:30:07 +02:00
|
|
|
{
|
|
|
|
test: /\.scss$/,
|
|
|
|
use: [
|
|
|
|
'file-loader?name=[hash].css',
|
|
|
|
'extract-loader',
|
|
|
|
'css-loader',
|
|
|
|
'sass-loader'
|
|
|
|
]
|
|
|
|
},
|
2016-11-27 17:43:59 +01:00
|
|
|
{
|
2020-03-30 12:19:54 +02:00
|
|
|
type: 'javascript/auto',
|
2016-11-27 17:43:59 +01:00
|
|
|
test: /manifest\.json$|\.xml$/,
|
2020-03-30 10:36:57 +02:00
|
|
|
use: [
|
2016-11-27 17:43:59 +01:00
|
|
|
'file-loader',
|
|
|
|
'extract-loader',
|
2020-03-30 12:19:54 +02:00
|
|
|
{
|
|
|
|
loader: 'regexp-replace-loader',
|
|
|
|
options: {
|
|
|
|
match: {
|
|
|
|
pattern: "#require\\('([^']*)'\\)",
|
|
|
|
flags: 'g'
|
|
|
|
},
|
|
|
|
replaceWith: '"+require("$1")+"'
|
|
|
|
}
|
|
|
|
},
|
2016-11-27 17:43:59 +01:00
|
|
|
'raw-loader'
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2020-03-30 10:36:57 +02:00
|
|
|
test: /\.(svg|png|ico)$/,
|
|
|
|
use: [
|
|
|
|
'file-loader'
|
|
|
|
]
|
2016-11-27 17:43:59 +01:00
|
|
|
},
|
2020-03-31 16:05:14 +02:00
|
|
|
{
|
|
|
|
test: /worker\.js$/,
|
|
|
|
use: { loader: 'worker-loader' }
|
|
|
|
},
|
2016-11-27 17:43:59 +01:00
|
|
|
{
|
2020-03-30 10:36:57 +02:00
|
|
|
enforce: 'post',
|
|
|
|
test: /mumble-streams\/lib\/data.js/,
|
|
|
|
use: [
|
|
|
|
'transform-loader?brfs'
|
|
|
|
]
|
2016-11-27 17:43:59 +01:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2020-03-30 10:36:57 +02:00
|
|
|
target: 'web'
|
2016-11-27 17:43:59 +01:00
|
|
|
}
|