Simplify webpack config

This commit is contained in:
2026-05-02 11:15:56 +02:00
parent 95ebc96484
commit 0cc7fc336a
2 changed files with 113 additions and 185 deletions

View File

@@ -1,5 +1,5 @@
const path = require('path');
const { SRC, DIST, ASSETS, LIB } = require('./paths');
const { SRC, DIST, LIB } = require('./paths');
const webpack = require('webpack');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
@@ -53,32 +53,21 @@ module.exports = {
use: ["vue-style-loader", "css-loader"],
}, {
test: /\.(png|svg|jpg|jpeg|gif)$/i,
use: {
loader: "url-loader",
options: {
limit: 1 * 1024,
//name: "images/[name].[hash:7].[ext]"
name: "images/[name].[ext]"
}
}
/*type: 'asset',
type: 'asset',
parser: {
dataUrlCondition: {
maxSize: 8*1024
maxSize: 1 * 1024
}
}*/
},
generator: {
filename: 'images/[name][ext]'
}
}
]
},
plugins: [
new CopyWebpackPlugin({
patterns: [/*{
from: 'geo/',
to: path.resolve(DIST, 'geo')
}, {
from: path.resolve(SRC, 'images/icons'),
to: 'images/icons'
}, */{
patterns: [{
from: path.resolve(LIB, 'index.php'),
to: 'index.php'
},
@@ -100,7 +89,7 @@ module.exports = {
new VueLoaderPlugin()
],
resolve: {
extensions: ['', '.js'],
extensions: ['.js', '.vue', '...'],
alias: {
"@scripts": path.resolve(SRC, "scripts")
}