diff --git a/e2e/fixtures/ssr-target-bundle/README.md b/e2e/fixtures/ssr-target-bundle/README.md new file mode 100644 index 000000000..183341d89 --- /dev/null +++ b/e2e/fixtures/ssr-target-bundle/README.md @@ -0,0 +1,3 @@ +# SSR Bundling for NPM packages with environment depended code parts + +Choosing the right code based on the `export` section of the `react-textarea-autosize` module based on the backend server deployment target ('node' | 'webworker') and the client browser. No browser only code should be bundled with server only code. diff --git a/e2e/fixtures/ssr-target-bundle/package.json b/e2e/fixtures/ssr-target-bundle/package.json new file mode 100644 index 000000000..daff6ef3c --- /dev/null +++ b/e2e/fixtures/ssr-target-bundle/package.json @@ -0,0 +1,23 @@ +{ + "name": "ssr-target-bundle", + "version": "0.1.0", + "type": "module", + "private": true, + "scripts": { + "dev": "waku dev --with-ssr", + "build": "waku build --with-ssr", + "start": "waku start --with-ssr" + }, + "dependencies": { + "react": "18.3.0-canary-4b2a1115a-20240202", + "react-dom": "18.3.0-canary-4b2a1115a-20240202", + "react-server-dom-webpack": "18.3.0-canary-4b2a1115a-20240202", + "react-textarea-autosize": "^8.5.3", + "waku": "workspace:*" + }, + "devDependencies": { + "@types/react": "18.2.55", + "@types/react-dom": "18.2.19", + "typescript": "5.3.3" + } +} diff --git a/e2e/fixtures/ssr-target-bundle/src/components/App.tsx b/e2e/fixtures/ssr-target-bundle/src/components/App.tsx new file mode 100644 index 000000000..904e52da3 --- /dev/null +++ b/e2e/fixtures/ssr-target-bundle/src/components/App.tsx @@ -0,0 +1,13 @@ +import { Textarea } from './Textarea.js'; + +const App = ({ name }: { name: string }) => { + return ( +
+ Waku example +

{name}

+