create-react-app-typescript icon indicating copy to clipboard operation
create-react-app-typescript copied to clipboard

Add SASS support

Open thefill opened this issue 7 years ago • 18 comments

I have noticed .scss files are not supported in your fork - I have altered configs so css/scss files are compiled via webpack (no need for external sass compiler).

thefill avatar Jul 12 '18 16:07 thefill

It lacks a dependency to node-sass package.

Bogala avatar Jul 13 '18 10:07 Bogala

@Bogala thanks a lot for pointing this out - will take a look at this.

thefill avatar Jul 13 '18 13:07 thefill

@Bogala dependency added - one of the global packages must have fulfilled this dependency. Thanks again!

thefill avatar Jul 13 '18 13:07 thefill

@Bogala looks like travis-ci failure is due to to issue with "npm cache clean". Can we execute CI again?

thefill avatar Jul 13 '18 17:07 thefill

Apparently npm cache clean should be run with --force. More about this issue here

thefill avatar Jul 13 '18 18:07 thefill

what about node-sass-chokidar ?

clakech avatar Jul 17 '18 13:07 clakech

@clakech that is indeed a valid replacement - in fact, its recommended in "react-create-app" doc. Thanks

thefill avatar Jul 17 '18 13:07 thefill

@thefill it is an issue node-sass with npm5. Use node-sass-chokidar will surely allow to pass the CI job

Bogala avatar Jul 17 '18 13:07 Bogala

@Bogala just done that! thanks @Bogala & @clakech for the assistance ;-)

thefill avatar Jul 17 '18 13:07 thefill

Any chance to merge this pr ? ;-)

thefill avatar Jul 20 '18 23:07 thefill

Oh yes please

Le sam. 21 juil. 2018 à 01:08, Filip Dabrowski [email protected] a écrit :

Any chance to merge this pr ? ;-)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/wmonk/create-react-app-typescript/pull/362#issuecomment-406748148, or mute the thread https://github.com/notifications/unsubscribe-auth/ABHXhn0cNWXPjPie6sDjq3Y87hc0ZXHUks5uImMFgaJpZM4VNUBB .

-- Cyril Lakech

clakech avatar Jul 21 '18 07:07 clakech

This fork aims to maintain feature parity with CRA as far as this makes sense considering the technical circumstances - so, at first glance: No, it's favored to wait for CRA to provide this.

Yet ... there is support for scss/sass on the next branch, i.e. it will be released with V2.0, so I'd say it's valid to somewhat "pre-pick" this as long as matches their implementation as far as feasible.

Which means that there are two changes to take care of:

  • The pattern should match for both scss and sass files.
  • Remove the node-sass resp. node-sass-chokidar dependency. The latter doesn't have any use here anyway, since its watcher is not used anyway. Regarding node-sass, it seems to be favorable to let users install it in case they need this feature, esp. since it has a native dependency (libsass) - at least that was mentioned in some of the threads on CRA discussing sass support.

DorianGrey avatar Jul 23 '18 06:07 DorianGrey

I forked this repo and added sass-loader support: https://github.com/kmturley/create-react-app-typescript/commit/896190a709b4dff393067ac30f63ae3b5bd23693

I pushed to npm as: https://www.npmjs.com/package/react-scripts-scss-ts

Which means you can start apps using: npx create-react-app react-typescript-scss-new --scripts-version=react-scripts-scss-ts

kmturley avatar Aug 23 '18 19:08 kmturley

This is fixed in CRA 2.

nickserv avatar Sep 01 '18 23:09 nickserv

now CRA2 is here, what are the plan to use CRA2/SASS/TypeScript ?

cyril-lakech avatar Sep 28 '18 09:09 cyril-lakech

Hi all,

I've created a fork merging @thefill 's changes with the latest create-react-app-typescript/master and changed the webpack configs to use the new CRA 2.0 method.

Unfortunately, either @thefill 's repository does not accept PRs or Github is bugging out, so if @thefill wants to PR my PR into his PR, that seems like the proper way to do this, otherwise I can PR this repository directly.

https://github.com/nimblelight/create-react-app-typescript/tree/thefill/master-2

johnrom avatar Sep 28 '18 17:09 johnrom

Hey @johnrom its github's issue I'm afraid - have no restrictions from my side ;-/ best if you can PR it directly if you be so kind ;-)

btw I abandoned those scripts completely with all its complex webpack configs... for last few weeks my team is using parcel & all is sooooooo much faster / better / easier. If anybody fancy I can create a quick&dirty public repo with a sample setup.

thefill avatar Sep 28 '18 17:09 thefill

ok, then this PR can be closed, I'll make a reference from my PR to here for documentation purposes.

I think my team will stick with the create-react-app method, maybe we'll revisit Parcel after we've had to eject and our lives have become more complicated.

johnrom avatar Oct 01 '18 13:10 johnrom