From 86785182a6b24c84cfb9e89dba2270b59ee348e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zsef=20Farkas?= Date: Sat, 16 Apr 2016 21:36:27 +0200 Subject: [PATCH] Add svg sprite generator for icons. --- package.json | 1 + webpack.config.js | 22 +++++++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index c92972a9..28bee2c0 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "typings": "^0.7.12", "webpack": "^1.13.0", "webpack-dev-server": "^1.14.1", + "webpack-svgstore-plugin": "^2.1.5", "xml-loader": "^1.1.0", "yargs": "^4.2.0", "zone.js": "^0.6.11" diff --git a/webpack.config.js b/webpack.config.js index 9b563645..666ce548 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,4 +1,5 @@ // var webpack = require("webpack"); +var SvgStore = require('webpack-svgstore-plugin'); module.exports = { entry: ['reflect-metadata', 'zone.js', 'es6-shim', "./src/boot.ts"], @@ -21,9 +22,24 @@ module.exports = { loaders: [ { test: /\.ts$/, loader: 'ts-loader', exclude: /node_modules/ } ] - }/*, + }, plugins: [ - new webpack.optimize.UglifyJsPlugin({ minimize: true }) - ]*/ + // new webpack.optimize.UglifyJsPlugin({ minimize: true }) + new SvgStore( + [ + 'images/icons/**/*.svg' + ], + './', + { + name: 'compiled_sprite.svg', + chunk: 'app', + svgoOptions: { + plugins: [ + { removeTitle: true } + ] + } + } + ) + ] } \ No newline at end of file