react-electron-starter icon indicating copy to clipboard operation
react-electron-starter copied to clipboard

Adding jsx and sass extensions to webpack loader config

Open ab18556 opened this issue 8 years ago • 3 comments

I've notice that the sass loader's regex was not matching.sass extension, and the js loader was matching .j instead of .jsx

I'm new to webpack tho so I might be wrong or not understanding some concepts

ab18556 avatar May 11 '17 03:05 ab18556

Hey @ab18556 !

Thanks you so much for this! Most React components use a .js extension (in my experience). But the loader should catch .js or .jsx? I might be wrong on that. The sass loader update is spot on. I typically use .scss extensions, but the loader should allow both scss and sass extensions.

alanbsmith avatar May 11 '17 03:05 alanbsmith

Hi @alanbsmith ,

About .jsx, I was asking myself which file extension should I personnaly use. I decided to go with the community and use .js, but much people still prefer .jsx

I think the .j extension should not be matched though.

About .sass, I prefer .scss too, but why not including both and let people choose? :)

Nice little project btw, I was looking for a concise setup that would help me to do electron+react apps so this is exactly what I was looking for.

Thanks, Pat

ab18556 avatar May 11 '17 10:05 ab18556

Yeah, I'm happy to support both .js and .jsx as well as scss and sass. I thought the line that's there would catch both.

{ test: /\.js?$/, loader: 'babel', exclude: /node_modules/ },

But I could be wrong. I haven't looked at this starter in a while. I can verify that sometime this morning though. Thanks again for the PR! We'll get it merged soon!

alanbsmith avatar May 11 '17 12:05 alanbsmith