-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.icons.js
More file actions
42 lines (38 loc) · 1.05 KB
/
webpack.config.icons.js
File metadata and controls
42 lines (38 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
"use strict";
const path = require('path');
const SpriteLoaderPlugin = require('svg-sprite-loader/plugin');
const distPath = path.join(__dirname, './packages/plg_system_jupwa/media/jupwa');
const config = {
entry: {
sprite: './src/js/sprite.js'
},
output: {
filename: `./sprite/[name].js`,
path: distPath,
},
module: {
rules: [
{
test: /\.svg$/,
type: 'asset',
use: [
{
loader: 'svg-sprite-loader',
options: {
extract: true,
spriteFilename: "icons.svg",
outputPath: 'icons/',
publicPath: '/app/icons/'
}
},
'svg-transform-loader',
'svgo-loader'
]
}
]
},
plugins: [
new SpriteLoaderPlugin({plainSprite: true})
]
};
module.exports = config;