diff --git a/package.json b/package.json index 280b7169..8077a99d 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "webpack": "^1.14.0", "webpack-dev-server": "^1.16.2", "webpack-fail-plugin": "^1.0.5", - "webpack-svgstore-plugin": "^2.2.2" + "webpack-svgstore-plugin": "^3.0.6" }, "dependencies": { "@angular/common": "2.3.1", diff --git a/src/services/mapper.service.ts b/src/services/mapper.service.ts index 34d86ed2..d377e5b7 100644 --- a/src/services/mapper.service.ts +++ b/src/services/mapper.service.ts @@ -1,3 +1,6 @@ +const svgIcons = { path: '../../images/icons/**/*.svg', name: 'assets/compiled_sprite.svg' }; +require('webpack-svgstore-plugin/src/helpers/svgxhr')(svgIcons); + import { Injectable } from '@angular/core'; @Injectable() diff --git a/src/webpack.config.js b/src/webpack.config.js index 84a42266..a26f9752 100644 --- a/src/webpack.config.js +++ b/src/webpack.config.js @@ -15,7 +15,7 @@ module.exports = { devtool: 'source-map', resolve: { extensions: ['', '.webpack.js', '.web.js', '.ts', '.js'], - modules: [ path.join(rootDir, "node_modules") ] + modules: [path.join(rootDir, "node_modules")] }, module: { loaders: [ @@ -30,21 +30,13 @@ module.exports = { }, plugins: [ // new webpack.optimize.UglifyJsPlugin({ minimize: true }) - new SvgStore( - [ - rootDir + '/images/icons/**/*.svg' - ], - './', - { - name: 'assets/compiled_sprite.svg', - chunk: 'app', - svgoOptions: { - plugins: [ - { removeTitle: true } - ] - } + new SvgStore({ + svgoOptions: { + plugins: [ + { removeTitle: true } + ] } - ), + }), webpackFailPlugin, new CopyWebpackPlugin([ { from: './src/*.html', flatten: true },