ttrss-theme-rsshub/webpack.config.js

54 lines
1.5 KiB
JavaScript

const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const WebpackShellPlugin = require('webpack-shell-plugin');
module.exports = {
mode: 'production',
entry: {
sagiri: './src/sagiri.less'
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].js'
},
module: {
rules: [
{
test: /\.less$/,
use: [
MiniCssExtractPlugin.loader,
'css-loader?-url',
{
loader: 'postcss-loader',
options: {
ident: 'postcss',
plugins: [
require('autoprefixer')({}),
]
}
},
'less-loader'
]
},
// {
// test: /\.(png|woff|woff2|eot|ttf|svg|gif)$/,
// use: [
// {
// loader: 'url-loader',
// options: {
// limit: 8192
// }
// }
// ]
// }
]
},
plugins: [
new MiniCssExtractPlugin({
filename: '[name].css'
}),
new WebpackShellPlugin({
onBuildEnd: ['rm dist/sagiri.js']
})
]
}