2020-05-04 12:44:12 +02:00
|
|
|
const common = require('./webpack.common');
|
|
|
|
const merge = require('webpack-merge');
|
2020-05-06 17:02:56 +03:00
|
|
|
const packageConfig = require('./package.json');
|
2020-08-15 12:44:52 +02:00
|
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
2019-09-30 23:51:46 +03:00
|
|
|
|
|
|
|
module.exports = merge(common, {
|
2020-05-04 12:44:12 +02:00
|
|
|
mode: 'development',
|
2020-08-15 12:44:52 +02:00
|
|
|
entry: './scripts/standalone.js',
|
|
|
|
devtool: 'source-map',
|
2019-10-01 02:58:05 +03:00
|
|
|
module: {
|
|
|
|
rules: [
|
2020-08-15 12:44:52 +02:00
|
|
|
{
|
|
|
|
test: /\.(html)$/,
|
|
|
|
use: {
|
|
|
|
loader: 'html-loader'
|
|
|
|
}
|
|
|
|
},
|
2020-02-28 14:36:42 +01:00
|
|
|
{
|
|
|
|
test: /\.js$/,
|
2020-09-01 13:32:12 +03:00
|
|
|
exclude: /node_modules[\\/](?!date-fns|epubjs|libarchive|jellyfin-apiclient|query-string|split-on-first|strict-uri-encode|xmldom)/,
|
2020-05-06 17:02:56 +03:00
|
|
|
use: {
|
|
|
|
loader: 'babel-loader',
|
|
|
|
options: {
|
|
|
|
presets: packageConfig.babel.presets
|
|
|
|
}
|
|
|
|
}
|
2020-02-28 14:36:42 +01:00
|
|
|
},
|
2019-10-01 02:58:05 +03:00
|
|
|
{
|
|
|
|
test: /\.css$/i,
|
2020-05-06 17:02:56 +03:00
|
|
|
use: [
|
|
|
|
'style-loader',
|
|
|
|
'css-loader',
|
|
|
|
{
|
|
|
|
loader: 'postcss-loader',
|
2020-05-08 13:50:04 +03:00
|
|
|
options: {
|
|
|
|
config: {
|
|
|
|
path: __dirname
|
|
|
|
}
|
|
|
|
}
|
2020-05-06 17:02:56 +03:00
|
|
|
}
|
|
|
|
]
|
2019-10-01 02:58:05 +03:00
|
|
|
},
|
|
|
|
{
|
2020-08-15 12:44:52 +02:00
|
|
|
test: /\.(png|jpg|gif|svg)$/i,
|
2020-05-04 12:44:12 +02:00
|
|
|
use: ['file-loader']
|
2020-01-19 12:57:09 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.(woff|woff2|eot|ttf|otf)$/,
|
|
|
|
use: [
|
2020-04-25 14:07:20 +02:00
|
|
|
'file-loader'
|
2020-01-19 12:57:09 +01:00
|
|
|
]
|
2020-04-15 18:09:34 +02:00
|
|
|
},
|
|
|
|
{
|
2020-05-05 12:01:43 +02:00
|
|
|
test: /\.(mp3)$/i,
|
|
|
|
use: ['file-loader']
|
2019-10-01 02:58:05 +03:00
|
|
|
}
|
|
|
|
]
|
2020-08-15 12:44:52 +02:00
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new HtmlWebpackPlugin({
|
|
|
|
filename: 'index.html',
|
|
|
|
template: 'index.html'
|
|
|
|
})
|
|
|
|
]
|
2019-09-30 23:51:46 +03:00
|
|
|
});
|