jellyfin-web/webpack.dev.js
2020-11-05 23:11:47 +00:00

71 lines
1.9 KiB
JavaScript

const path = require('path');
const common = require('./webpack.common');
const merge = require('webpack-merge');
const packageConfig = require('./package.json');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = merge(common, {
mode: 'development',
entry: './scripts/standalone.js',
devtool: 'source-map',
module: {
rules: [
{
test: /\.(html)$/,
use: {
loader: 'html-loader'
}
},
{
test: /\.js$/,
exclude: /node_modules[\\/](?!date-fns|epubjs|query-string|split-on-first)/,
use: {
loader: 'babel-loader',
options: {
presets: packageConfig.babel.presets
}
}
},
{
test: /\.css$/i,
use: [
'style-loader',
'css-loader',
{
loader: 'postcss-loader',
options: {
config: {
path: __dirname
}
}
}
]
},
{
test: /\.(png|jpg|gif|svg)$/i,
use: ['file-loader']
},
{
test: /\.(woff|woff2|eot|ttf|otf)$/,
use: [
'file-loader'
]
},
{
test: /\.(mp3)$/i,
use: ['file-loader']
}
]
},
plugins: [
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'index.html'
})
],
devServer: {
contentBase: path.join(__dirname, 'dist'),
compress: true
}
});