File tree Expand file tree Collapse file tree 2 files changed +39
-7
lines changed Expand file tree Collapse file tree 2 files changed +39
-7
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ const WriteFilePlugin = require('write-file-webpack-plugin');
15
15
const npmSass = require ( 'npm-sass' ) ;
16
16
const merge = require ( 'webpack-merge' ) ;
17
17
const SassDocPlugin = require ( '@bolt/sassdoc-webpack-plugin' ) ;
18
+ const svgoConfig = require ( './svgo-config' ) ;
18
19
const { getConfig } = require ( '@bolt/build-utils/config-store' ) ;
19
20
const { boltWebpackProgress } = require ( '@bolt/build-utils/webpack-helpers' ) ;
20
21
const {
@@ -269,6 +270,35 @@ async function createWebpackConfig(buildConfig) {
269
270
} ,
270
271
module : {
271
272
rules : [
273
+ // @todo : uncomment once future updates to handle SVG icon spritesheet in place
274
+ // {
275
+ // test: /\.svg$/,
276
+ // include: path.dirname(require.resolve('@bolt/components-icons/package.json')),
277
+ // use: [
278
+ // 'svg-sprite-loader',
279
+ // 'svgo-loader'
280
+ // ]
281
+ // },
282
+
283
+ // minify non spritesheet SVGs icons
284
+ {
285
+ test : / \. s v g $ / ,
286
+ // exclude: ,
287
+ use : [
288
+ {
289
+ loader : 'file-loader' ,
290
+ options : {
291
+ name : path . join ( path . dirname ( require . resolve ( '@bolt/components-icons/package.json' ) ) , 'dist/[name].min.[ext]' , )
292
+ } ,
293
+ } ,
294
+ {
295
+ loader : 'svgo-loader' ,
296
+ options : {
297
+ plugins : svgoConfig ,
298
+ } ,
299
+ } ,
300
+ ] ,
301
+ } ,
272
302
{
273
303
test : / \. ( t s | t s x ) $ / ,
274
304
loader : 'ts-loader' ,
@@ -314,7 +344,7 @@ async function createWebpackConfig(buildConfig) {
314
344
} ,
315
345
} ,
316
346
{
317
- test : / \. ( c u r | s v g ) $ / ,
347
+ test : / \. ( c u r ) $ / ,
318
348
loader : 'file-loader' ,
319
349
options : {
320
350
name : '[name].[ext]' ,
Original file line number Diff line number Diff line change 15
15
"bin" : {
16
16
"bolt" : " index.js"
17
17
},
18
- "browserslist" : [
19
- " extends @bolt/browserslist-config"
20
- ],
21
18
"scripts" : {
22
19
"test" : " FORCE_COLOR=1 npx lerna exec --scope @bolt/build-tools--test* --concurrency 1 -- npm run test"
23
20
},
21
+ "browserslist" : [
22
+ " extends @bolt/browserslist-config"
23
+ ],
24
24
"dependencies" : {
25
25
"@babel/core" : " ^7.4.5" ,
26
26
"@bolt/api" : " ^2.6.0" ,
56
56
"eslint" : " ^5.16.0" ,
57
57
"eslint-loader" : " ^2.1.2" ,
58
58
"express" : " ^4.17.1" ,
59
- "file-loader" : " ^3.0.1 " ,
59
+ "file-loader" : " ^4.2.0 " ,
60
60
"front-matter" : " ^3.0.2" ,
61
61
"fs-extra" : " ^8.0.1" ,
62
62
"globby" : " ^9.2.0" ,
86
86
"sharp" : " ^0.22.1" ,
87
87
"string-replace-loader" : " ^2.1.1" ,
88
88
"style-loader" : " ^0.23.1" ,
89
- "svgo" : " ^1.2.2" ,
89
+ "svg-sprite-loader" : " ^4.1.6" ,
90
+ "svgo" : " ^1.3.0" ,
91
+ "svgo-loader" : " ^2.2.1" ,
90
92
"ts-loader" : " ^6.0.2" ,
91
93
"typescript" : " ^3.5.1" ,
92
94
"uglifyjs-webpack-plugin" : " ^2.1.3" ,
114
116
}
115
117
],
116
118
"schema" : " utils/config.schema.yml"
117
- }
119
+ }
You can’t perform that action at this time.
0 commit comments