You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So, I'm building a serverless lambda function that uses solidjs for SSR.
I've based my code on the ssr-example in the solidjs repo.
This example uses only js, in the examples/shared/src/components/App.js it doesn't even use App.jsx but App.js.
Now what I would like to do, is use vite and typescript to develop my site.
And then bundle it up with rollup into a module I can import into the lambda-function that runs in lambda-node-environment. That lambda function is minified using sam build into a a single lambda.js file with no dependencies.
So far, I've setup a minimal test example which works as long as I don't use typescript, as well as rename the App.jsx to an App.js.
If I try rollup -c rollup.config.js while having App.jsx in the site folder, I get:
$ rollup -c rollup.config.js
index.tsx → lib...
[!] Error: Could not resolve '../site/src/App' from index.tsx
Error: Could not resolve '../site/src/App' from index.tsx
My `rollup.config.js`:
importjsxfrom'acorn-jsx';importnodeResolvefrom'@rollup/plugin-node-resolve';importcommonfrom'@rollup/plugin-commonjs';importbabelfrom'@rollup/plugin-babel';importtypescriptfrom'@rollup/plugin-typescript';exportdefault[{input: "index.jsx",// replace with index.tsx to get [!] Error: Could not resolve '../site/src/App' from index.tsxoutput: [{dir: "lib",exports: "auto",format: "cjs"}],external: ["solid-js","solid-js/web"],acornInjectPlugins: [jsx()],plugins: [typescript({tsconfig: "./tsconfig.json"}),nodeResolve({preferBuiltins: true,exportConditions: ["solid","node"]}),babel({babelHelpers: "bundled",presets: [["solid",{generate: "ssr",hydratable: true}]]}),common()]}];
Of course, you can also try running it yourself, after cloning https://github.com/Bersaelor/solid-rollup-aws-lambda , the default works, but if you rename the App.js to App.jsx it'll show the error.
Or rename input: "index.jsx" to input: "index.tsx" and get the same error , just with typescript.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
So, I'm building a serverless lambda function that uses solidjs for SSR.
I've based my code on the ssr-example in the solidjs repo.
This example uses only js, in the
examples/shared/src/components/App.js
it doesn't even useApp.jsx
butApp.js
.Now what I would like to do, is use vite and typescript to develop my site.
And then bundle it up with rollup into a module I can import into the lambda-function that runs in lambda-node-environment. That lambda function is minified using
sam build
into a a singlelambda.js
file with no dependencies.So far, I've setup a minimal test example which works as long as I don't use typescript, as well as rename the
App.jsx
to anApp.js
.If I try
rollup -c rollup.config.js
while havingApp.jsx
in the site folder, I get:My `rollup.config.js`:
My `tsconfig.json`:
Of course, you can also try running it yourself, after cloning https://github.com/Bersaelor/solid-rollup-aws-lambda , the default works, but if you rename the
App.js
toApp.jsx
it'll show the error.Or rename
input: "index.jsx"
toinput: "index.tsx"
and get the same error , just with typescript.Beta Was this translation helpful? Give feedback.
All reactions