#webpack issues
65 messages · Page 1 of 1 (latest)
module.exports = {
entry: './src/index.js',
module: {
rules: [
{
test: /\.m?js/,
type: "javascript/auto",
},
{
test: /\.m?js/,
resolve: {
fullySpecified: false,
},
},
],
}
}```
CRA?
create-react-app
uh it was a template and i'm new to react so i am not sure but i'm using yarn
new = 1 month
i know how to create components and stuff
what command did you run
it was a template so the files were already created but i don't have create-react-app in package.json
so it wasn't that
it'd be react-scripts in package.json
CRA should have automatically set up the webpack config properly
well the thing is initially it wasn't like that i've just changed it now
is there a command i could run
and it would configure it?
if you're actually using CRA, you cannot add a webpack.config.js config like that. you have to eject first then modify everything. glhf after that, though...
but again, if you're actually using CRA, you shouldn't need to. it should already work.
i hhave react-scripts right there
and when i do
yarn start
to start the dev mode
it doesnt work
attempting to run CRA to test, but as always it's taking forever. you should look into Vite
ya, you have something wrong
import reportWebVitals from './reportWebVitals';
no extension but it works just fine
yea if i remove the type: "module"
ya, why would you even do that (add type:module)?
i want to use react-email
and?
react-scripts are the node script you're running. that has absolutely nothing to do with the browser app you're building
"backend" and CRA don't mix
how would i import the email.jsx tho (an example)
in your react app...
but i need it in my backend
email.tsx is an example of how you implement react-email, which is a client-side library.
yea but i use nodemailer to send emails
here is the example showing you how to configure it to use your email server (nodemailer backend): https://github.com/resendlabs/react-email/blob/main/examples/nodemailer/src/index.tsx
yea they use import
...
i cant use import with commonjs
NONE OF THAT IS BACKEND CODE
no?
it is all clearly React components, so no...
...
im srry bruh