Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Conversation

s-robertson
Copy link

@s-robertson s-robertson commented Nov 20, 2017

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 new info object when calling optimize, which allows IDs to be prefixed using the new prefixIds plugin.

Here's an example of the info object in use: https://github.com/svg/svgo/blob/a6d2c88f9ca128e145d06b05bd9b87c1985b0a15/examples/test.js#L15-L28


cb(null, `module.exports = {${component}};`);
});
cb(null, `module.exports = {${component}};`);

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)}`;

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 });

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}}`;

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 });

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) => {

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').

@s-robertson s-robertson changed the title Upgrade to SVGO 1.0.0 Upgrade to SVGO 1.0.0+ Nov 20, 2017
@damianstasik damianstasik mentioned this pull request Jan 30, 2018
@damianstasik
Copy link
Owner

Fixed in v0.5, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants