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