File tree 2 files changed +0
-80
lines changed
2 files changed +0
-80
lines changed Original file line number Diff line number Diff line change @@ -83,67 +83,3 @@ plugins:
83
83
` ` `
84
84
85
85
You can use ` YML` or `JSON` files as external configs.
86
-
87
- # ## Legacy Webpack v1 config
88
-
89
- There are two ways of loading svgo configuration.
90
- You can pass it as a JSON string after loader name, like this :
91
-
92
- ` ` ` javascript
93
- // webpack.config.js
94
-
95
- var svgoConfig = JSON.stringify({
96
- plugins: [
97
- {removeTitle: true},
98
- {convertColors: {shorthex: false}},
99
- {convertPathData: false}
100
- ]
101
- });
102
-
103
- module.exports = {
104
- ...
105
- module: {
106
- loaders: [
107
- {
108
- test: /.*\. svg$/,
109
- loaders: [
110
- 'file-loader',
111
- 'svgo-loader?' + svgoConfig
112
- ]
113
- }
114
- ]
115
- }
116
- }
117
- ` ` `
118
-
119
- Or you can save svgo config in your main webpack config object,
120
- and then specify name of the property in the loader query string.
121
-
122
- However, this option will not work in Webpack 2.<br>
123
- This is only shown here in the documentation for backwards compatibility.
124
-
125
- ` ` ` javascript
126
- // webpack.config.js
127
-
128
- module.exports = {
129
- ...
130
- module: {
131
- loaders: [
132
- {
133
- test: /.*\. svg$/,
134
- loaders: [
135
- 'file-loader',
136
- 'svgo-loader?useConfig=svgoConfig1'
137
- ]
138
- }
139
- ]
140
- },
141
- svgoConfig1: {
142
- plugins: [
143
- {removeTitle: true},
144
- {convertColors: {shorthex: false}},
145
- {convertPathData: false}
146
- ]
147
- }
148
- }
149
- ` ` `
Original file line number Diff line number Diff line change @@ -10,22 +10,6 @@ module.exports = function(source) {
10
10
11
11
var config = loaderUtils . getOptions ( this ) || { } ;
12
12
13
- // This piece of code exists in order to support webpack 1.x.x top level configurations.
14
- // In webpack 2 this options does not exists anymore.
15
- // Please use the `options` field of the loader to pass your configuration
16
- if ( config . useConfig ) {
17
- var configName = config . useConfig ;
18
- var config = this . options [ configName ] ;
19
- if ( config === undefined ) {
20
- callback ( new Error (
21
- 'You specified "useConfig=' + configName +
22
- '" for svgo-loader, but there is no property named "' + configName +
23
- '" in your main webpack configuration.'
24
- ) ) ;
25
- return ;
26
- }
27
- }
28
-
29
13
// Ported from:
30
14
// https://github.com/svg/svgo/blob/174c37208017e5909d5f7db2e8faba49663a945a/lib/svgo/coa.js#L175-L192
31
15
if ( typeof config . externalConfig === 'string' ) {
You can’t perform that action at this time.
0 commit comments