-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to SVGO 1.0.0+ #16
Conversation
|
||
cb(null, `module.exports = {${component}};`); | ||
}); | ||
cb(null, `module.exports = {${component}};`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'template literal syntax' is only available in ES6 (use 'esversion: 6').
let component = `render: function () {${compiled.render}}`; | ||
if (options.includePath || query.includePath) { | ||
const filename = loaderUtils.interpolateName(this, '[path][name].[ext]', { context: this.options.context }); | ||
component = `${component}, path:${JSON.stringify(filename)}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'template literal syntax' is only available in ES6 (use 'esversion: 6').
const compiled = compiler.compile(result.data, { preserveWhitespace: false }); | ||
let component = `render: function () {${compiled.render}}`; | ||
if (options.includePath || query.includePath) { | ||
const filename = loaderUtils.interpolateName(this, '[path][name].[ext]', { context: this.options.context }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
svgo.optimize(content, { path: this.resourcePath }) | ||
.then((result) => { | ||
const compiled = compiler.compile(result.data, { preserveWhitespace: false }); | ||
let component = `render: function () {${compiled.render}}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
'template literal syntax' is only available in ES6 (use 'esversion: 6').
} | ||
svgo.optimize(content, { path: this.resourcePath }) | ||
.then((result) => { | ||
const compiled = compiler.compile(result.data, { preserveWhitespace: false }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
return cb(result.error); | ||
} | ||
svgo.optimize(content, { path: this.resourcePath }) | ||
.then((result) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').
Fixed in v0.5, thank you! |
In addition to upgrading to the latest version of SVGO, this PR also switches to the new Promise-based method of calling
svgo.optimize
and also provides the newinfo
object when callingoptimize
, which allows IDs to be prefixed using the newprefixIds
plugin.Here's an example of the
info
object in use: https://github.com/svg/svgo/blob/a6d2c88f9ca128e145d06b05bd9b87c1985b0a15/examples/test.js#L15-L28