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

Using svg-url-loader for webpack configs that accept svgs #3221

Merged
merged 3 commits into from
Mar 21, 2018

Conversation

wuweiweiwu
Copy link
Member

Issue: #2474

What I did

Added svg-url-loader to make svg imports smaller

How to test

build core, docs, examples

Is this testable with jest or storyshots?
No
Does this need a new example in the kitchen sink apps?
No
Does this need an update to the documentation?
No
If your answer is yes to any of these, please make sure to include it in your PR.

@Hypnosphi
Copy link
Member

Can someone please check that it works on #3148 branch?

@wuweiweiwu
Copy link
Member Author

Sure Ill do that in a bit!

@wuweiweiwu
Copy link
Member Author

wuweiweiwu commented Mar 16, 2018

@Hypnosphi It worked! :)

except some stuff with webpack 4 that I had to add:

uglifyjs is its own plugin in webpack 4 yarn add -D uglifyjs-webpack-plugin
webpack command is now in its own cli yarn add -D webpack-cli

But other than that It works (I checked out upstream/webpack-4 and manually applied changes from this PR, rebase was getting messy)

@Hypnosphi
Copy link
Member

Hypnosphi commented Mar 16, 2018

uglifyjs is its own plugin in webpack 4 yarn add -D uglifyjs-webpack-plugin

Actually, it's used as default optimization.minimizer option in webpack 4, so there's no need to depend on it directly

webpack command is now in its own cli yarn add -D webpack-cli

Storybook doesn't use webpack CLI command, only node API

@wuweiweiwu
Copy link
Member Author

@Hypnosphi My mistake. I was directly running yarn build in the vue-kitchen-sink directory.

Is there anything else to be done on this PR?

@wuweiweiwu
Copy link
Member Author

Seems like danger ci has no api token

@codecov
Copy link

codecov bot commented Mar 17, 2018

Codecov Report

Merging #3221 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3221   +/-   ##
=======================================
  Coverage   35.61%   35.61%           
=======================================
  Files         442      442           
  Lines        9777     9777           
  Branches      911      927   +16     
=======================================
  Hits         3482     3482           
+ Misses       5716     5711    -5     
- Partials      579      584    +5
Impacted Files Coverage Δ
.../core/src/server/config/defaults/webpack.config.js 0% <ø> (ø) ⬆️
app/polymer/src/server/utils.js 0% <0%> (-100%) ⬇️
addons/actions/src/lib/util/typeReplacer.js 54.54% <0%> (ø) ⬆️
lib/core/src/server/config/env.js 0% <0%> (ø) ⬆️
addons/storysource/src/loader/parse-helpers.js 46.75% <0%> (ø) ⬆️
lib/ui/src/modules/ui/libs/filters.js 48.64% <0%> (ø) ⬆️
lib/ui/src/libs/withLifecycleDecorator.js 17.14% <0%> (ø) ⬆️
addons/info/src/components/types/OneOfType.js 60% <0%> (ø) ⬆️
addons/actions/src/lib/types/function/index.js 77.77% <0%> (ø) ⬆️
lib/core/src/client/manager/preview.js 0% <0%> (ø) ⬆️
... and 72 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 01ebb65...650831f. Read the comment docs.

@wuweiweiwu
Copy link
Member Author

wuweiweiwu commented Mar 18, 2018

@Hypnosphi seems that noquotes breaks polymer svg imports. But for others it doesnt. So I've removed it. And docs svg imports (logo) still works!

@Hypnosphi Hypnosphi requested a review from danielduan March 18, 2018 00:40
@Hypnosphi Hypnosphi merged commit e042efa into storybookjs:master Mar 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants