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

Add option to disable optimization. #15

Merged
merged 3 commits into from Jun 28, 2017

Conversation

tkh44
Copy link
Contributor

@tkh44 tkh44 commented Jun 21, 2017

closes #10

Disable with

"plugins": [
  ["inline-react-svg", { svgo: false }]
]

src/index.js Outdated
@@ -16,7 +16,7 @@ let ignoreRegex;

export default ({ types: t }) => ({
visitor: {
ImportDeclaration(path, state) {
ImportDeclaration (path, state) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's leave this part as-is to align with the Airbnb Styleguide

src/index.js Outdated
const optimizedSvgSource = optimize(svgSource, state.opts.svgo);
const escapeSvgSource = escapeBraces(optimizedSvgSource);
const rawSource = readFileSync(svgPath, 'utf8');
let optimizedSource = state.opts.svgo === false
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like these conditions might be backwards?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh my 😅

@tkh44
Copy link
Contributor Author

tkh44 commented Jun 28, 2017

Should be good to go now @kesne

@kesne
Copy link
Collaborator

kesne commented Jun 28, 2017

LGTM! This is awesome, thank you so mcuh!

@kesne kesne merged commit ca9ca20 into airbnb:master Jun 28, 2017
@tkh44 tkh44 deleted the 10-optimization-disable-option branch June 28, 2017 20:18
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.

Add option to disable optimization.
2 participants