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

Helpful if modules react-svg-loader and sass-loader get added. #4199

Closed
Mayank009 opened this issue Mar 22, 2018 · 5 comments
Closed

Helpful if modules react-svg-loader and sass-loader get added. #4199

Mayank009 opened this issue Mar 22, 2018 · 5 comments

Comments

@Mayank009
Copy link

Mayank009 commented Mar 22, 2018

It will be really helpful if we get modules React SVG Loader and Sass Loader implemented by default in web-pack configs.

Why it will be helpful:

  1. After adding "React SVG Loader" all svgs files will be injected as a part of HTML instead of fetching as file.
  2. After adding "Sass Loader" addition of "build-css" and "watch-css" scripts in package.json will not be required for those who are writing sass files directly.
@mattfysh
Copy link

mattfysh commented Mar 23, 2018

@Mayank009 there is an SVG loader included in the v2 react-scripts, you can import { ReactComponent as Icon } from './icon.svg'

re: SASS, I don't think this will be added, due to its decline in popularity against the current wave of CSS-in-JS solutions

@iansu
Copy link
Contributor

iansu commented Mar 23, 2018

We have been working to add SASS support. See this PR for details: #4195

@Mayank009
Copy link
Author

Mayank009 commented Mar 23, 2018

@mattfysh I can see the implementation you mentioned is there in Web-pack file but cannot see same changes in my project even though I have migrated to latest version of react-scripts using command npm install --save --save-exact react-scripts@1.1.1 .

@Mayank009 Mayank009 reopened this Mar 23, 2018
@mattfysh
Copy link

@Mayank009 yea it's a little confusing, I agree. The "main" branch in this repo is now next, which is being deployed to npm under 2.0.0-next.* versions. I believe you can get this release by doing:

For a new app:
create-react-app myapp --scripts-version react-scripts@next

For an existing app:
cd myapp & yarn add react-scripts@next

There's a nice website called libraries.io where you can see the versions deployed: https://libraries.io/npm/react-scripts - good luck!

@Mayank009
Copy link
Author

@mattfysh it worked for me. Thanks :)

@lock lock bot locked and limited conversation to collaborators Jan 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants