const fileLoader = [
{
loader: 'file-loader',
options: {
name: fileAsset,
outputPath: 'assets',
context: 'assets',
publicPath: '/prod/webpack/assets',
useRelativePath: false,
}
}
]
const rules = [
{
test: /\.js$/,
enforce: 'pre',
use: ['source-map-loader'],
},
{
test: /\.worker\.js$/,
use: { loader: 'worker-loader' }
},
{
test: /\.(css|less)$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
options: {
},
},
'css-loader',
{
loader: 'less-loader',
}],
},
{
test: /\.html$/,
use: [{
loader: 'html-loader',
options: {
minimize: minimize,
//caseSensitive: true
}
}]
},
{
test: /\.(png|jpe?g|gif|ico)$/,
use: fileLoader
},
{
test: /\.woff(\?v=\d+\.\d+\.\d+)?$/,
use: fileLoader
}, {
test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/,
use: fileLoader
}, {
test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
use: fileLoader
}, {
test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,
use: fileLoader
}, {
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
use: fileLoader
},
]