mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-16 10:28:18 -07:00
98 lines
2.6 KiB
JavaScript
98 lines
2.6 KiB
JavaScript
const path = require('path');
|
|
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
|
const CopyPlugin = require('copy-webpack-plugin');
|
|
const packageConfig = require('./package.json');
|
|
|
|
module.exports = {
|
|
context: path.resolve(__dirname, 'src'),
|
|
target: 'web',
|
|
resolve: {
|
|
modules: [
|
|
path.resolve(__dirname, 'node_modules')
|
|
]
|
|
},
|
|
plugins: [
|
|
new CleanWebpackPlugin(),
|
|
new CopyPlugin({
|
|
patterns: [
|
|
{
|
|
from: 'themes/',
|
|
to: 'themes/'
|
|
},
|
|
{
|
|
from: 'assets/**',
|
|
globOptions: {
|
|
ignore: ['**/css/*']
|
|
}
|
|
},
|
|
{
|
|
from: '*.*',
|
|
globOptions: {
|
|
ignore: ['**.js', '**.html']
|
|
}
|
|
}
|
|
]
|
|
})
|
|
],
|
|
output: {
|
|
filename: '[name].bundle.js',
|
|
path: path.resolve(__dirname, 'dist')
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.(html)$/,
|
|
use: {
|
|
loader: 'html-loader'
|
|
}
|
|
},
|
|
{
|
|
test: /\.js$/,
|
|
exclude: /node_modules[\\/](?!date-fns|epubjs)/,
|
|
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']
|
|
},
|
|
{
|
|
test: require.resolve('jquery'),
|
|
loader: 'expose-loader',
|
|
options: {
|
|
exposes: ['$', 'jQuery']
|
|
}
|
|
}
|
|
]
|
|
}
|
|
};
|