├── .editorconfig ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── labeler.yml └── workflows │ ├── ci.yml │ ├── code-pushup.yml │ ├── pr-commitlint.yml │ ├── pr-labeler.yml │ └── release.yml ├── .gitignore ├── .husky └── pre-push ├── .nx └── workflows │ └── agents.yaml ├── .prettierignore ├── .prettierrc ├── .verdaccio └── config.yml ├── .vscode ├── extensions.json └── settings.json ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── apps ├── docs │ ├── Dockerfile │ ├── eslint.config.js │ ├── eslint.next.config.js │ ├── package.json │ ├── project.json │ ├── public │ │ ├── angular_gradient.png │ │ ├── favicon.ico │ │ ├── github-mark.svg │ │ ├── logo-small.png │ │ ├── robots.txt │ │ ├── rsbuild-logo.svg │ │ ├── rspack-logo.svg │ │ └── sitemap.xml │ ├── rsbuild.config.ts │ ├── src │ │ ├── app │ │ │ ├── app.component.scss │ │ │ ├── app.component.ts │ │ │ ├── app.config.server.ts │ │ │ ├── app.config.ts │ │ │ └── app.routes.ts │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── hljs.theme.scss │ │ ├── index.html │ │ ├── main.server.ts │ │ ├── main.ts │ │ ├── pages │ │ │ ├── api │ │ │ │ ├── api.component.ts │ │ │ │ ├── rsbuild │ │ │ │ │ ├── create-config │ │ │ │ │ │ ├── create-config.component.html │ │ │ │ │ │ ├── create-config.component.scss │ │ │ │ │ │ └── create-config.component.ts │ │ │ │ │ ├── create-server │ │ │ │ │ │ ├── create-server.component.html │ │ │ │ │ │ └── create-server.component.ts │ │ │ │ │ └── with-configurations │ │ │ │ │ │ ├── with-configurations.component.html │ │ │ │ │ │ ├── with-configurations.component.scss │ │ │ │ │ │ └── with-configurations.component.ts │ │ │ │ └── rspack │ │ │ │ │ └── create-config │ │ │ │ │ ├── create-config.component.html │ │ │ │ │ ├── create-config.component.scss │ │ │ │ │ └── create-config.component.ts │ │ │ ├── getting-started │ │ │ │ ├── introduction │ │ │ │ │ ├── introduction.component.html │ │ │ │ │ └── introduction.component.ts │ │ │ │ └── quick-start │ │ │ │ │ ├── quick-start.component.html │ │ │ │ │ └── quick-start.component.ts │ │ │ ├── guide │ │ │ │ └── migration │ │ │ │ │ ├── configurations │ │ │ │ │ ├── configurations.component.html │ │ │ │ │ └── configurations.component.ts │ │ │ │ │ └── from-webpack │ │ │ │ │ ├── from-webpack.component.html │ │ │ │ │ └── from-webpack.component.ts │ │ │ └── home │ │ │ │ ├── home.component.html │ │ │ │ └── home.component.ts │ │ ├── server.ts │ │ ├── styles.scss │ │ └── ui │ │ │ ├── api │ │ │ └── api-option.component.ts │ │ │ ├── callout │ │ │ └── callout.component.ts │ │ │ ├── code-block │ │ │ └── code-block.component.ts │ │ │ ├── drawer.component.ts │ │ │ ├── footer.component.ts │ │ │ ├── navbar.component.ts │ │ │ └── syntax-highlighter │ │ │ ├── syntax-highlighter.directive.ts │ │ │ └── syntax-highlighter.provider.ts │ ├── tsconfig.app.json │ ├── tsconfig.app.tsbuildinfo │ ├── tsconfig.editor.json │ └── tsconfig.json └── tsconfig.base.json ├── code-pushup.config.ts ├── commitlint.config.mjs ├── contributing ├── linting │ └── eslint.md └── testing │ └── readme.md ├── e2e ├── fixtures │ ├── rsbuild-csr-css │ │ ├── eslint.config.js │ │ ├── eslint.next.config.js │ │ ├── package.json │ │ ├── public │ │ │ └── favicon.ico │ │ ├── rsbuild.config.ts │ │ ├── src │ │ │ ├── app │ │ │ │ ├── app.component.css │ │ │ │ ├── app.component.html │ │ │ │ ├── app.component.spec.ts │ │ │ │ ├── app.component.ts │ │ │ │ ├── app.config.ts │ │ │ │ ├── app.routes.ts │ │ │ │ └── nx-welcome.component.ts │ │ │ ├── index.html │ │ │ ├── main.ts │ │ │ └── styles.css │ │ ├── test-setup.ts │ │ ├── tsconfig.app.json │ │ ├── tsconfig.app.tsbuildinfo │ │ ├── tsconfig.editor.json │ │ ├── tsconfig.json │ │ ├── tsconfig.spec.json │ │ ├── vite.config.mts │ │ └── vitest.config.mts │ ├── rsbuild-csr-less │ │ ├── eslint.config.js │ │ ├── package.json │ │ ├── public │ │ │ └── favicon.ico │ │ ├── rsbuild.config.ts │ │ ├── src │ │ │ ├── app │ │ │ │ ├── app.component.html │ │ │ │ ├── app.component.less │ │ │ │ ├── app.component.spec.ts │ │ │ │ ├── app.component.ts │ │ │ │ ├── app.config.ts │ │ │ │ ├── app.routes.ts │ │ │ │ └── nx-welcome.component.ts │ │ │ ├── index.html │ │ │ ├── main.ts │ │ │ └── styles.less │ │ ├── test-setup.ts │ │ ├── tsconfig.app.json │ │ ├── tsconfig.app.tsbuildinfo │ │ ├── tsconfig.editor.json │ │ ├── tsconfig.json │ │ ├── tsconfig.spec.json │ │ ├── vite.config.mts │ │ └── vitest.config.mts │ ├── rsbuild-csr-scss │ │ ├── eslint.config.js │ │ ├── eslint.next.config.js │ │ ├── package.json │ │ ├── public │ │ │ └── favicon.ico │ │ ├── rsbuild.config.ts │ │ ├── src │ │ │ ├── app │ │ │ │ ├── app.component.html │ │ │ │ ├── app.component.scss │ │ │ │ ├── app.component.spec.ts │ │ │ │ ├── app.component.ts │ │ │ │ ├── app.config.ts │ │ │ │ ├── app.routes.ts │ │ │ │ └── nx-welcome.component.ts │ │ │ ├── index.html │ │ │ ├── main.ts │ │ │ └── styles.scss │ │ ├── test-setup.ts │ │ ├── tsconfig.app.json │ │ ├── tsconfig.app.tsbuildinfo │ │ ├── tsconfig.editor.json │ │ ├── tsconfig.json │ │ ├── tsconfig.spec.json │ │ ├── vite.config.mts │ │ └── vitest.config.mts │ ├── rsbuild-ssr-css │ │ ├── eslint.config.js │ │ ├── eslint.next.config.js │ │ ├── package.json │ │ ├── public │ │ │ └── favicon.ico │ │ ├── rsbuild.config.ts │ │ ├── src │ │ │ ├── app │ │ │ │ ├── app.component.css │ │ │ │ ├── app.component.html │ │ │ │ ├── app.component.spec.ts │ │ │ │ ├── app.component.ts │ │ │ │ ├── app.config.server.ts │ │ │ │ ├── app.config.ts │ │ │ │ ├── app.routes.ts │ │ │ │ └── nx-welcome.component.ts │ │ │ ├── index.html │ │ │ ├── main.server.ts │ │ │ ├── main.ts │ │ │ ├── server.ts │ │ │ └── styles.css │ │ ├── test-setup.ts │ │ ├── tsconfig.app.json │ │ ├── tsconfig.app.tsbuildinfo │ │ ├── tsconfig.editor.json │ │ ├── tsconfig.json │ │ ├── tsconfig.spec.json │ │ ├── vite.config.mts │ │ └── vitest.config.mts │ ├── rspack-appshell-css │ │ ├── eslint.next.config.js │ │ ├── package.json │ │ ├── public │ │ │ └── favicon.ico │ │ ├── rspack.config.js │ │ ├── src │ │ │ ├── app │ │ │ │ ├── app.component.css │ │ │ │ ├── app.component.html │ │ │ │ ├── app.component.ts │ │ │ │ ├── app.config.server.ts │ │ │ │ ├── app.config.ts │ │ │ │ ├── app.routes.ts │ │ │ │ ├── bar │ │ │ │ │ └── bar.component.ts │ │ │ │ ├── foo.component.ts │ │ │ │ ├── nested │ │ │ │ │ ├── child-a │ │ │ │ │ │ └── child-a.component.ts │ │ │ │ │ ├── child-b │ │ │ │ │ │ └── child-b.component.ts │ │ │ │ │ ├── nested.component.ts │ │ │ │ │ └── nested.routes.ts │ │ │ │ └── nx-welcome.component.ts │ │ │ ├── index.html │ │ │ ├── main.server.ts │ │ │ ├── main.ts │ │ │ ├── server.ts │ │ │ └── styles.css │ │ ├── tsconfig.app.json │ │ ├── tsconfig.editor.json │ │ └── tsconfig.json │ ├── rspack-csr-css │ │ ├── eslint.next.config.js │ │ ├── package.json │ │ ├── proxy.conf.json │ │ ├── public │ │ │ └── favicon.ico │ │ ├── rspack.config.js │ │ ├── scripts │ │ │ ├── internal-shared-script.js │ │ │ ├── non-initial-script.js │ │ │ ├── script1.js │ │ │ └── script2.js │ │ ├── src │ │ │ ├── api.mjs │ │ │ ├── app │ │ │ │ ├── api.service.ts │ │ │ │ ├── app.component.css │ │ │ │ ├── app.component.html │ │ │ │ ├── app.component.ts │ │ │ │ ├── app.config.ts │ │ │ │ ├── app.routes.ts │ │ │ │ ├── app.worker.ts │ │ │ │ ├── nx-welcome.component.ts │ │ │ │ └── scss-inline-test.ts │ │ │ ├── index.html │ │ │ ├── main.ts │ │ │ └── styles.css │ │ ├── tsconfig.app.json │ │ ├── tsconfig.app.tsbuildinfo │ │ ├── tsconfig.editor.json │ │ └── tsconfig.json │ ├── rspack-csr-i18n │ │ ├── eslint.next.config.js │ │ ├── package.json │ │ ├── public │ │ │ ├── angular-rspack-logo-small.avif │ │ │ └── favicon.ico │ │ ├── rspack.config.js │ │ ├── src │ │ │ ├── app │ │ │ │ ├── app.component.css │ │ │ │ ├── app.component.html │ │ │ │ ├── app.component.ts │ │ │ │ ├── app.config.ts │ │ │ │ └── app.routes.ts │ │ │ ├── index.html │ │ │ ├── locale │ │ │ │ ├── messages.es.xlf │ │ │ │ ├── messages.fr.xlf │ │ │ │ └── messages.xlf │ │ │ ├── main.ts │ │ │ └── styles.css │ │ ├── tsconfig.app.json │ │ ├── tsconfig.app.tsbuildinfo │ │ ├── tsconfig.editor.json │ │ └── tsconfig.json │ ├── rspack-csr-scss │ │ ├── eslint.config.js │ │ ├── package.json │ │ ├── public │ │ │ └── favicon.ico │ │ ├── rspack.config.js │ │ ├── src │ │ │ ├── app │ │ │ │ ├── app.component.html │ │ │ │ ├── app.component.scss │ │ │ │ ├── app.component.ts │ │ │ │ ├── app.config.ts │ │ │ │ └── app.routes.ts │ │ │ ├── index.html │ │ │ ├── main.ts │ │ │ └── styles.scss │ │ ├── tsconfig.app.json │ │ ├── tsconfig.editor.json │ │ └── tsconfig.json │ ├── rspack-csr-tailwind │ │ ├── .postcssrc.json │ │ ├── eslint.config.js │ │ ├── package.json │ │ ├── public │ │ │ └── favicon.ico │ │ ├── rspack.config.js │ │ ├── src │ │ │ ├── app │ │ │ │ ├── app.component.css │ │ │ │ ├── app.component.html │ │ │ │ ├── app.component.ts │ │ │ │ ├── app.config.ts │ │ │ │ └── app.routes.ts │ │ │ ├── index.html │ │ │ ├── main.ts │ │ │ └── styles.css │ │ ├── tsconfig.app.json │ │ ├── tsconfig.editor.json │ │ └── tsconfig.json │ ├── rspack-ssg-css │ │ ├── eslint.next.config.js │ │ ├── package.json │ │ ├── public │ │ │ └── favicon.ico │ │ ├── rspack.config.js │ │ ├── src │ │ │ ├── app │ │ │ │ ├── app.component.css │ │ │ │ ├── app.component.html │ │ │ │ ├── app.component.ts │ │ │ │ ├── app.config.server.ts │ │ │ │ ├── app.config.ts │ │ │ │ ├── app.routes.ts │ │ │ │ ├── bar │ │ │ │ │ └── bar.component.ts │ │ │ │ ├── foo.component.ts │ │ │ │ ├── nested │ │ │ │ │ ├── child-a │ │ │ │ │ │ └── child-a.component.ts │ │ │ │ │ ├── child-b │ │ │ │ │ │ └── child-b.component.ts │ │ │ │ │ ├── nested.component.ts │ │ │ │ │ └── nested.routes.ts │ │ │ │ └── nx-welcome.component.ts │ │ │ ├── index.html │ │ │ ├── main.server.ts │ │ │ ├── main.ts │ │ │ ├── server.ts │ │ │ └── styles.css │ │ ├── tsconfig.app.json │ │ ├── tsconfig.editor.json │ │ └── tsconfig.json │ ├── rspack-ssr-css │ │ ├── eslint.next.config.js │ │ ├── package.json │ │ ├── public │ │ │ └── favicon.ico │ │ ├── rspack.config.js │ │ ├── src │ │ │ ├── app │ │ │ │ ├── app.component.css │ │ │ │ ├── app.component.html │ │ │ │ ├── app.component.ts │ │ │ │ ├── app.config.server.ts │ │ │ │ ├── app.config.ts │ │ │ │ ├── app.routes.ts │ │ │ │ ├── foo.component.ts │ │ │ │ └── nx-welcome.component.ts │ │ │ ├── index.html │ │ │ ├── main.server.ts │ │ │ ├── main.ts │ │ │ ├── server.ts │ │ │ └── styles.css │ │ ├── tsconfig.app.json │ │ ├── tsconfig.app.tsbuildinfo │ │ ├── tsconfig.editor.json │ │ └── tsconfig.json │ └── shared │ │ ├── assets │ │ └── src │ │ │ └── assets │ │ │ └── icons │ │ │ └── github.png │ │ ├── scripts │ │ └── shared-script.js │ │ └── styles │ │ └── src │ │ ├── base.scss │ │ ├── index.scss │ │ └── lib │ │ └── global.scss ├── rsbuild-csr-css-e2e │ ├── eslint.config.js │ ├── playwright.config.ts │ ├── project.json │ ├── src │ │ └── example.spec.ts │ ├── tsconfig.json │ └── tsconfig.test.json ├── rsbuild-csr-less-e2e │ ├── eslint.config.js │ ├── eslint.next.config.js │ ├── playwright.config.ts │ ├── project.json │ ├── src │ │ └── example.spec.ts │ ├── tsconfig.json │ └── tsconfig.test.json ├── rsbuild-csr-scss-e2e │ ├── eslint.config.js │ ├── eslint.next.config.js │ ├── eslint.next.config.js~merged │ ├── playwright.config.ts │ ├── project.json │ ├── src │ │ └── example.spec.ts │ └── tsconfig.json ├── rsbuild-ssr-css-e2e │ ├── eslint.config.js │ ├── eslint.next.config.js │ ├── playwright.config.ts │ ├── project.json │ ├── src │ │ └── example.spec.ts │ └── tsconfig.json └── tsconfig.base.json ├── eslint.config.js ├── eslint ├── README.md ├── eslint.config.js ├── eslint.next.config.js ├── package.json └── src │ └── lib │ ├── config │ ├── javascript.js │ └── vitest.js │ └── utils │ ├── patterns.js │ └── utils.js ├── nx.json ├── package.json ├── packages ├── angular-rsbuild │ ├── .npmignore │ ├── README.md │ ├── code-pushup.config.ts │ ├── eslint.config.js │ ├── eslint.next.config.js │ ├── mocks │ │ └── fixtures │ │ │ └── integration │ │ │ └── minimal │ │ │ ├── other │ │ │ └── mock.main.ts │ │ │ ├── rsbuild.mock.config.ts │ │ │ ├── src │ │ │ └── mock.main.ts │ │ │ ├── tsconfig.mock.json │ │ │ └── tsconfig.other.mock.json │ ├── package.json │ ├── src │ │ ├── index.ts │ │ └── lib │ │ │ ├── config │ │ │ ├── __snapshots__ │ │ │ │ ├── create-config.csr.ts │ │ │ │ └── create-config.ssr.ts │ │ │ ├── create-config.integration.test.ts │ │ │ ├── create-config.ts │ │ │ ├── create-config.unit.test.ts │ │ │ ├── dev-server-config-utils.ts │ │ │ ├── dev-server-config-utils.unit.test.ts │ │ │ ├── helpers.integration.test.ts │ │ │ ├── helpers.ts │ │ │ ├── helpers.unit.test.ts │ │ │ ├── load-esm.ts │ │ │ ├── styles-utils.ts │ │ │ └── styles-utils.unit.test.ts │ │ │ ├── models │ │ │ ├── normalize-options.d.ts │ │ │ ├── normalize-options.ts │ │ │ ├── normalize-options.unit.test.ts │ │ │ ├── plugin-options.d.ts │ │ │ └── plugin-options.ts │ │ │ ├── plugin │ │ │ ├── plugin-angular-jit.ts │ │ │ ├── plugin-angular.ts │ │ │ └── plugin-hoisted-js-transformer.ts │ │ │ └── ssr │ │ │ └── server.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ ├── tsconfig.spec.json │ ├── vitest.config.mts │ └── vitest.integration.config.mts ├── angular-rspack-compiler │ ├── .npmignore │ ├── README.md │ ├── code-pushup.config.ts │ ├── eslint.config.js │ ├── eslint.next.config.js │ ├── mocks │ │ └── fixtures │ │ │ └── integration │ │ │ └── minimal │ │ │ ├── other │ │ │ └── mock.main.ts │ │ │ ├── rsbuild.mock.config.ts │ │ │ ├── src │ │ │ ├── mock.main.ts │ │ │ └── styles.css │ │ │ ├── tsconfig.mock.json │ │ │ └── tsconfig.other.mock.json │ ├── package.json │ ├── patch │ │ └── patch-angular-build.js │ ├── src │ │ ├── compilation │ │ │ ├── augments.d.ts │ │ │ ├── augments.integration.test.ts │ │ │ ├── augments.ts │ │ │ ├── augments.unit.test.ts │ │ │ ├── build-and-analyze.d.ts │ │ │ ├── build-and-analyze.ts │ │ │ ├── index.ts │ │ │ ├── setup-compilation.d.ts │ │ │ ├── setup-compilation.integration.test.ts │ │ │ ├── setup-compilation.ts │ │ │ ├── setup-compilation.unit.test.ts │ │ │ ├── setup-with-angular-compilation.ts │ │ │ └── setup-with-angular-compilation.unit.test.ts │ │ ├── index.ts │ │ ├── models │ │ │ ├── compiler-plugin-options.d.ts │ │ │ ├── compiler-plugin-options.ts │ │ │ ├── file-replacement.ts │ │ │ ├── index.d.ts │ │ │ ├── index.ts │ │ │ ├── inline-style-language.ts │ │ │ └── style-preprocessor-options.ts │ │ └── utils │ │ │ ├── component-resolvers.d.ts │ │ │ ├── component-resolvers.ts │ │ │ ├── component-resolvers.unit.test.ts │ │ │ ├── constants.ts │ │ │ ├── index.ts │ │ │ ├── load-compiler-cli.ts │ │ │ ├── regex-filters.d.ts │ │ │ ├── regex-filters.ts │ │ │ ├── regex-filters.unit.test.ts │ │ │ ├── source-file-cache.d.ts │ │ │ ├── source-file-cache.ts │ │ │ ├── source-file-cache.unit.test.ts │ │ │ ├── targets-from-browsers.ts │ │ │ ├── targets-from-browsers.unit.test.ts │ │ │ ├── utils.ts │ │ │ └── utils.unit.test.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ ├── tsconfig.spec.json │ ├── vitest.config.mts │ └── vitest.integration.config.mts └── angular-rspack │ ├── .npmignore │ ├── README.md │ ├── code-pushup.config.ts │ ├── eslint.config.js │ ├── eslint.next.config.js │ ├── package.json │ ├── src │ └── lib │ │ ├── config │ │ ├── config-utils │ │ │ ├── browser-config.ts │ │ │ ├── common-config.ts │ │ │ ├── dev-server-config-utils.ts │ │ │ ├── entry-points.ts │ │ │ ├── get-stats-options.ts │ │ │ ├── helpers.ts │ │ │ ├── optimization-config.ts │ │ │ ├── server-config.ts │ │ │ ├── sourcemap-utils.ts │ │ │ ├── style-config-utils.ts │ │ │ └── user-defined-config-helpers.ts │ │ ├── create-config.ts │ │ ├── create-config.unit.test.ts │ │ └── i18n │ │ │ └── create-i18n-options.ts │ │ ├── index.d.ts │ │ ├── index.ts │ │ ├── models │ │ ├── angular-rspack-plugin-options.ts │ │ ├── augmented-compilation.ts │ │ ├── i18n.ts │ │ ├── index.ts │ │ └── normalize-options.ts │ │ ├── plugins │ │ ├── angular-rspack-plugin.ts │ │ ├── angular-ssr-dev-server.ts │ │ ├── any-component-style-budget-checker-plugin.ts │ │ ├── client │ │ │ └── ssr-reload-client.ts │ │ ├── i18n-inline-plugin.ts │ │ ├── index-html-plugin.ts │ │ ├── loaders │ │ │ ├── angular-partial-transform.loader.ts │ │ │ ├── angular-transform.loader.ts │ │ │ ├── angular-transform.loader.unit.test.ts │ │ │ ├── hmr-accept-loader.ts │ │ │ ├── hmr-accept.ts │ │ │ └── platform-server-exports.loader.ts │ │ ├── ng-rspack.ts │ │ ├── prerender-plugin.ts │ │ ├── progress-plugin.ts │ │ ├── rxjs-esm-resolution.ts │ │ ├── server │ │ │ └── ssr-reload-server.ts │ │ ├── stats-json-plugin.ts │ │ ├── suppress-js-for-css-chunks-plugin.ts │ │ ├── tools │ │ │ ├── dev-tools-ignore-plugin.ts │ │ │ ├── render-worker.ts │ │ │ ├── routes-extractor-worker.ts │ │ │ └── worker-pool.ts │ │ ├── transfer-size-plugin.ts │ │ └── watch-file-logs-plugin.ts │ │ └── utils │ │ ├── async-chunks.ts │ │ ├── color.ts │ │ ├── find-project-for-path.ts │ │ ├── get-locale-base-href.ts │ │ ├── graph.ts │ │ ├── i18n.ts │ │ ├── index-file │ │ ├── add-body-script.ts │ │ ├── add-event-dispatch-contract.ts │ │ ├── get-index-input-file.ts │ │ ├── get-index-output-file.ts │ │ └── html-rewriting-stream.ts │ │ ├── max-workers.ts │ │ ├── misc-helpers.ts │ │ ├── postcss-cli-resources.ts │ │ ├── postcss-configuration.ts │ │ ├── rspack-diagnostics.ts │ │ ├── spinner.ts │ │ ├── stats.ts │ │ ├── tty.ts │ │ └── url-join.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ ├── tsconfig.spec.json │ ├── vitest.config.mts │ └── vitest.integration.config.mts ├── pnpm-lock.yaml ├── pnpm-workspace.yaml ├── project.json ├── rsbuild-plugin-angular.png ├── testing ├── setup │ ├── README.md │ ├── eslint.config.js │ ├── eslint.next.config.js │ ├── package.json │ ├── src │ │ ├── index.d.ts │ │ └── index.mjs │ ├── tsconfig.json │ ├── tsconfig.lib.json │ ├── tsconfig.spec.json │ ├── vitest.config.mts │ └── vitest.integration.config.mts ├── utils │ ├── README.md │ ├── eslint.config.js │ ├── eslint.next.config.js │ ├── package.json │ ├── src │ │ ├── index.ts │ │ └── lib │ │ │ ├── constants.ts │ │ │ ├── e2e-setup.ts │ │ │ ├── os-agnostic-paths.ts │ │ │ ├── os-agnostic-paths.unit.test.ts │ │ │ └── source-file-from.code.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ ├── tsconfig.spec.json │ ├── vite.config.ts │ ├── vitest.config.mts │ └── vitest.integration.config.mts └── vitest-setup │ ├── README.md │ ├── eslint.config.js │ ├── eslint.next.config.js │ ├── package.json │ ├── src │ ├── index.ts │ └── lib │ │ └── fs-memfs.setup-file.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ ├── tsconfig.spec.json │ ├── vite.config.ts │ ├── vitest.config.mts │ └── vitest.integration.config.mts ├── tools ├── eslint-rules │ ├── index.ts │ ├── project.json │ ├── rules │ │ ├── vitest-config-has-test-coverage-configured.ts │ │ └── vitest-config-has-unique-cachedir-configured.ts │ ├── tsconfig.json │ ├── tsconfig.lint.json │ ├── tsconfig.spec.json │ └── utils │ │ ├── constants.ts │ │ ├── utils.ts │ │ └── vitest.ts ├── reports │ └── code-pushup.preset.config.ts ├── scripts │ ├── eslint-next │ │ ├── README.md │ │ ├── bin.ts │ │ ├── docs │ │ │ ├── cli.md │ │ │ ├── eslint-strategies.md │ │ │ ├── migrations.md │ │ │ ├── report.md │ │ │ └── usage-examples.md │ │ ├── index.ts │ │ └── src │ │ │ ├── file-creation.ts │ │ │ ├── nx.ts │ │ │ ├── reporting.ts │ │ │ └── utils.ts │ ├── release.ts │ ├── start-local-registry.ts │ └── stop-local-registry.ts └── tsconfig.tools.json ├── tsconfig.base.json ├── tsconfig.json └── vitest.workspace.ts /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/workflows/code-pushup.yml: -------------------------------------------------------------------------------- 1 | name: Code PushUp 2 | 3 | on: 4 | push: 5 | branches: [main] 6 | pull_request: 7 | branches: [main] 8 | 9 | permissions: 10 | contents: read 11 | actions: read 12 | pull-requests: write 13 | 14 | jobs: 15 | code-pushup: 16 | runs-on: ubuntu-latest 17 | name: Code PushUp 18 | timeout-minutes: 30 19 | steps: 20 | - name: Checkout repository 21 | uses: actions/checkout@v4 22 | 23 | - uses: pnpm/action-setup@v4 24 | 25 | - name: Install dependencies 26 | run: pnpm i --frozen-lockfile 27 | 28 | - uses: nrwl/nx-set-shas@v4 29 | 30 | - name: Collect Code PushUp report 31 | uses: code-pushup/github-action@v0.6.0 32 | env: 33 | NX_NO_CLOUD: true 34 | CP_API_KEY: ${{ secrets.CP_API_KEY }} 35 | ACTIONS_STEP_DEBUG: true 36 | with: 37 | monorepo: nx 38 | retention: 14 39 | -------------------------------------------------------------------------------- /.github/workflows/pr-commitlint.yml: -------------------------------------------------------------------------------- 1 | name: PR Commintlint 2 | env: 3 | NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} 4 | 5 | on: 6 | push: 7 | branches: 8 | - main 9 | pull_request: 10 | 11 | permissions: 12 | actions: read 13 | contents: read 14 | 15 | jobs: 16 | main: 17 | runs-on: ubuntu-latest 18 | steps: 19 | - uses: actions/checkout@v4 20 | with: 21 | fetch-depth: 0 22 | 23 | - uses: pnpm/action-setup@v4 24 | 25 | # Cache node_modules 26 | - uses: actions/setup-node@v4 27 | with: 28 | node-version: 20.12 29 | cache: 'pnpm' 30 | 31 | - run: pnpm i --frozen-lockfile 32 | - uses: nrwl/nx-set-shas@v4 33 | 34 | # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud 35 | # - run: npx nx-cloud record -- echo Hello World 36 | - run: pnpm nx-cloud record -- pnpm check-commit 37 | -------------------------------------------------------------------------------- /.github/workflows/pr-labeler.yml: -------------------------------------------------------------------------------- 1 | name: PR Labeler 2 | 3 | on: 4 | pull_request_target: 5 | types: [opened, synchronize] 6 | 7 | jobs: 8 | label: 9 | name: Add PR labels 10 | runs-on: ubuntu-latest 11 | permissions: 12 | pull-requests: write 13 | contents: read 14 | steps: 15 | - uses: actions/checkout@v4 16 | 17 | - uses: actions/labeler@v5 18 | with: 19 | repo-token: '${{ secrets.GITHUB_TOKEN }}' 20 | sync-labels: true 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | dist 5 | e2e/fixtures/**/build 6 | tmp 7 | /out-tsc 8 | out-tsc 9 | 10 | # dependencies 11 | node_modules 12 | 13 | # IDEs and editors 14 | /.idea 15 | .project 16 | .classpath 17 | .c9/ 18 | *.launch 19 | .settings/ 20 | *.sublime-workspace 21 | 22 | # IDE - VSCode 23 | .vscode/* 24 | !.vscode/settings.json 25 | !.vscode/tasks.json 26 | !.vscode/launch.json 27 | !.vscode/extensions.json 28 | 29 | # misc 30 | /.sass-cache 31 | /connect.lock 32 | /coverage 33 | /libpeerconnection.log 34 | npm-debug.log 35 | yarn-error.log 36 | testem.log 37 | /typings 38 | 39 | # System Files 40 | .DS_Store 41 | Thumbs.db 42 | 43 | .nx/cache 44 | .nx/workspace-data 45 | 46 | vite.config.*.timestamp* 47 | vitest.config.*.timestamp* 48 | 49 | .angular 50 | 51 | apps/docs/__deploy 52 | .env 53 | .code-pushup 54 | 55 | test-output 56 | .cursor/rules/nx-rules.mdc 57 | .github/instructions/nx.instructions.md 58 | -------------------------------------------------------------------------------- /.husky/pre-push: -------------------------------------------------------------------------------- 1 | pnpm check-format && 2 | pnpm check-commit 3 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # Add files here to ignore them from prettier formatting 2 | /dist 3 | /coverage 4 | /.nx/cache 5 | /.nx/workspace-data 6 | /pnpm-lock.yaml 7 | 8 | .angular 9 | apps/docs/src/pages/**/*.html 10 | __snapshots__ 11 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true 3 | } 4 | -------------------------------------------------------------------------------- /.verdaccio/config.yml: -------------------------------------------------------------------------------- 1 | # path to a directory with all packages 2 | storage: ../tmp/local-registry/storage 3 | 4 | # a list of other known repositories we can talk to 5 | uplinks: 6 | npmjs: 7 | url: https://registry.npmjs.org/ 8 | maxage: 60m 9 | 10 | packages: 11 | '**': 12 | # give all users (including non-authenticated users) full access 13 | # because it is a local registry 14 | access: $all 15 | publish: $all 16 | unpublish: $all 17 | 18 | # if package is not available locally, proxy requests to npm registry 19 | proxy: npmjs 20 | 21 | # log settings 22 | logs: 23 | type: stdout 24 | format: pretty 25 | level: warn 26 | 27 | publish: 28 | allow_offline: true # set offline to true to allow publish offline 29 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "nrwl.angular-console", 4 | "esbenp.prettier-vscode", 5 | "firsttris.vscode-jest-runner", 6 | "ms-playwright.playwright" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "eslint.validate": ["json"] 3 | } 4 | -------------------------------------------------------------------------------- /apps/docs/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM --platform=linux/amd64 node:18-alpine 2 | 3 | WORKDIR /app 4 | 5 | COPY dist ./ 6 | 7 | RUN npm install --global concurrently pm2@latest 8 | 9 | EXPOSE 4000 10 | CMD ["pm2-runtime", "node server/server.js"] 11 | -------------------------------------------------------------------------------- /apps/docs/eslint.config.js: -------------------------------------------------------------------------------- 1 | const nextEslintConfig = require('./eslint.next.config'); 2 | 3 | // 🚨 DO NOT EDIT THIS FILE MANUALLY! 🚨 4 | // Run `pnpm eslint-next/nx` to update or remove this file if all rules pass. 5 | // Add new rules globally to the `eslint.config.js` or locally to the `eslint.next.config.js` file. 6 | // For details, refer to: tools/scripts/eslint-next/README.md 7 | module.exports = [ 8 | ...nextEslintConfig, 9 | { 10 | files: ['**/*'], 11 | rules: { 12 | // ❌ Errors: 1 13 | '@typescript-eslint/no-unused-vars': 'off', // ❌ 6 errors 14 | }, 15 | }, 16 | ]; 17 | -------------------------------------------------------------------------------- /apps/docs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "devDependencies": { 4 | "@rsbuild/plugin-sass": "^1.1.2" 5 | }, 6 | "dependencies": { 7 | "@angular/common": "20.0.0", 8 | "@angular/core": "20.0.0", 9 | "@angular/material": "20.0.0", 10 | "@angular/platform-browser": "20.0.0", 11 | "@angular/router": "20.0.0", 12 | "@angular/ssr": "20.0.0", 13 | "@nx/angular-rsbuild": "workspace:*", 14 | "highlight.js": "^11.11.1" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /apps/docs/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "docs", 3 | "$schema": "../../node_modules/nx/schemas/project-schema.json", 4 | "projectType": "application", 5 | "prefix": "app", 6 | "sourceRoot": "apps/docs/src", 7 | "tags": [], 8 | "targets": { 9 | "build": { 10 | "parallelism": false 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /apps/docs/public/angular_gradient.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-rspack/c7c5b1259eb2ff33e68561eb9025f5dca2fe790d/apps/docs/public/angular_gradient.png -------------------------------------------------------------------------------- /apps/docs/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-rspack/c7c5b1259eb2ff33e68561eb9025f5dca2fe790d/apps/docs/public/favicon.ico -------------------------------------------------------------------------------- /apps/docs/public/github-mark.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /apps/docs/public/logo-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-rspack/c7c5b1259eb2ff33e68561eb9025f5dca2fe790d/apps/docs/public/logo-small.png -------------------------------------------------------------------------------- /apps/docs/public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Allow: / 3 | Disallow: /static/ 4 | 5 | Sitemap: https://angular-rspack.dev/sitemap.xml 6 | -------------------------------------------------------------------------------- /apps/docs/public/sitemap.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | https://angular-rspack.dev 5 | 6 | 7 | https://angular-rspack.dev/getting-started/introduction 8 | 9 | 10 | https://angular-rspack.dev/getting-started/quick-start 11 | 12 | 13 | https://angular-rspack.dev/api/rsbuild/create-server 14 | 15 | 16 | https://angular-rspack.dev/api/rsbuild/create-config 17 | 18 | 19 | -------------------------------------------------------------------------------- /apps/docs/rsbuild.config.ts: -------------------------------------------------------------------------------- 1 | import { pluginSass } from '@rsbuild/plugin-sass'; 2 | 3 | const options = { 4 | browser: './src/main.ts', 5 | server: './src/main.server.ts', 6 | ssr: { 7 | entry: './src/server.ts', 8 | }, 9 | inlineStyleLanguage: 'scss' as any, 10 | styles: ['./src/styles.scss', './src/hljs.theme.scss'], 11 | skipTypeChecking: true, 12 | }; 13 | 14 | export default () => { 15 | if (global.NX_GRAPH_CREATION === undefined) { 16 | const { createConfig } = require('@nx/angular-rsbuild'); 17 | return createConfig( 18 | { 19 | options, 20 | }, 21 | { 22 | production: { 23 | options: { 24 | fileReplacements: [ 25 | { 26 | replace: './src/environments/environment.ts', 27 | with: './src/environments/environment.prod.ts', 28 | }, 29 | ], 30 | }, 31 | }, 32 | } 33 | ); 34 | } 35 | return {}; 36 | }; 37 | -------------------------------------------------------------------------------- /apps/docs/src/app/app.component.scss: -------------------------------------------------------------------------------- 1 | .sidenav { 2 | padding: 2rem; 3 | max-width: 300px; 4 | } 5 | 6 | .content { 7 | display: flex; 8 | flex-direction: column; 9 | justify-content: center; 10 | align-items: center; 11 | padding: 2rem; 12 | padding-top: 64px; 13 | flex-grow: 1; 14 | } 15 | 16 | app-footer { 17 | margin-top: 2rem; 18 | width: 100%; 19 | } 20 | -------------------------------------------------------------------------------- /apps/docs/src/app/app.config.server.ts: -------------------------------------------------------------------------------- 1 | import { mergeApplicationConfig, ApplicationConfig } from '@angular/core'; 2 | import { provideServerRendering } from '@angular/ssr'; 3 | import { appConfig } from './app.config'; 4 | 5 | const serverConfig: ApplicationConfig = { 6 | providers: [provideServerRendering()], 7 | }; 8 | 9 | export const config = mergeApplicationConfig(appConfig, serverConfig); 10 | -------------------------------------------------------------------------------- /apps/docs/src/app/app.config.ts: -------------------------------------------------------------------------------- 1 | import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core'; 2 | import { provideRouter } from '@angular/router'; 3 | import { appRoutes } from './app.routes'; 4 | import { 5 | provideClientHydration, 6 | withEventReplay, 7 | } from '@angular/platform-browser'; 8 | import { provideAnimationsAsync } from '@angular/platform-browser/animations/async'; 9 | import { provideSyntaxHighlighter } from '../ui/syntax-highlighter/syntax-highlighter.provider'; 10 | 11 | export const appConfig: ApplicationConfig = { 12 | providers: [ 13 | provideClientHydration(withEventReplay()), 14 | provideZoneChangeDetection({ eventCoalescing: true }), 15 | provideRouter(appRoutes), 16 | provideAnimationsAsync(), 17 | provideSyntaxHighlighter(), 18 | ], 19 | }; 20 | -------------------------------------------------------------------------------- /apps/docs/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | name: 'production', 3 | }; 4 | -------------------------------------------------------------------------------- /apps/docs/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | name: 'development', 3 | }; 4 | -------------------------------------------------------------------------------- /apps/docs/src/main.server.ts: -------------------------------------------------------------------------------- 1 | import { bootstrapApplication } from '@angular/platform-browser'; 2 | import { AppComponent } from './app/app.component'; 3 | import { config } from './app/app.config.server'; 4 | 5 | const bootstrap = () => bootstrapApplication(AppComponent, config); 6 | 7 | export default bootstrap; 8 | -------------------------------------------------------------------------------- /apps/docs/src/main.ts: -------------------------------------------------------------------------------- 1 | import { bootstrapApplication } from '@angular/platform-browser'; 2 | import { appConfig } from './app/app.config'; 3 | import { AppComponent } from './app/app.component'; 4 | 5 | bootstrapApplication(AppComponent, appConfig).catch((err) => 6 | console.error(err) 7 | ); 8 | -------------------------------------------------------------------------------- /apps/docs/src/pages/api/api.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { RouterOutlet } from '@angular/router'; 3 | 4 | @Component({ 5 | imports: [RouterOutlet], 6 | selector: 'app-api', 7 | template: `

API Reference

8 | `, 9 | styles: [ 10 | ` 11 | :host { 12 | margin: 0 auto; 13 | max-width: 85vw; 14 | @media (min-width: 960px) { 15 | max-width: 70vw; 16 | } 17 | } 18 | 19 | h1 { 20 | padding-bottom: 2rem; 21 | border-bottom: 1px solid var(--mat-sys-surface-variant); 22 | margin-bottom: 4rem; 23 | } 24 | `, 25 | ], 26 | }) 27 | export class ApiComponent {} 28 | -------------------------------------------------------------------------------- /apps/docs/src/pages/api/rsbuild/create-config/create-config.component.scss: -------------------------------------------------------------------------------- 1 | :host { 2 | max-width: 90vw; 3 | margin: 0 auto; 4 | 5 | .spacer { 6 | border-top: 1px solid var(--mat-sys-surface-variant); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /apps/docs/src/pages/api/rsbuild/with-configurations/with-configurations.component.scss: -------------------------------------------------------------------------------- 1 | :host { 2 | max-width: 90vw; 3 | margin: 0 auto; 4 | 5 | .spacer { 6 | border-top: 1px solid var(--mat-sys-surface-variant); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /apps/docs/src/pages/api/rsbuild/with-configurations/with-configurations.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { MatTabsModule } from '@angular/material/tabs'; 3 | import { 4 | ApiOption, 5 | ApiOptionComponent, 6 | } from '../../../../ui/api/api-option.component'; 7 | import { CodeBlockComponent } from '../../../../ui/code-block/code-block.component'; 8 | import { MatList, MatListItem, MatNavList } from '@angular/material/list'; 9 | import { RouterLink } from '@angular/router'; 10 | 11 | @Component({ 12 | imports: [ 13 | MatTabsModule, 14 | ApiOptionComponent, 15 | CodeBlockComponent, 16 | MatListItem, 17 | RouterLink, 18 | MatNavList, 19 | ], 20 | preserveWhitespaces: true, 21 | selector: 'app-with-configurations', 22 | templateUrl: './with-configurations.component.html', 23 | styleUrls: ['./with-configurations.component.scss'], 24 | }) 25 | export class WithConfigurationsComponent { 26 | options: ApiOption[] = []; 27 | } 28 | -------------------------------------------------------------------------------- /apps/docs/src/pages/api/rspack/create-config/create-config.component.scss: -------------------------------------------------------------------------------- 1 | :host { 2 | max-width: 90vw; 3 | margin: 0 auto; 4 | 5 | .spacer { 6 | border-top: 1px solid var(--mat-sys-surface-variant); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /apps/docs/src/pages/getting-started/quick-start/quick-start.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { MatTabsModule } from '@angular/material/tabs'; 3 | import { CodeBlockComponent } from '../../../ui/code-block/code-block.component'; 4 | 5 | @Component({ 6 | imports: [MatTabsModule, CodeBlockComponent], 7 | preserveWhitespaces: true, 8 | selector: 'app-quick-start', 9 | templateUrl: './quick-start.component.html', 10 | styles: [ 11 | ` 12 | :host { 13 | max-width: 85vw; 14 | margin: 0 auto; 15 | @media (min-width: 960px) { 16 | max-width: 70vw; 17 | } 18 | } 19 | 20 | h1 { 21 | padding-bottom: 2rem; 22 | } 23 | 24 | h3 { 25 | padding-top: 1rem; 26 | } 27 | `, 28 | ], 29 | }) 30 | export class QuickStartComponent {} 31 | -------------------------------------------------------------------------------- /apps/docs/src/pages/guide/migration/configurations/configurations.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { RouterLink } from '@angular/router'; 3 | import { MatIcon } from '@angular/material/icon'; 4 | import { CodeBlockComponent } from '../../../../ui/code-block/code-block.component'; 5 | import { CalloutComponent } from '../../../../ui/callout/callout.component'; 6 | 7 | @Component({ 8 | preserveWhitespaces: true, 9 | selector: 'app-configurations', 10 | templateUrl: './configurations.component.html', 11 | styles: [ 12 | ` 13 | :host { 14 | margin: 0 auto; 15 | max-width: 85vw; 16 | @media (min-width: 960px) { 17 | max-width: 70vw; 18 | } 19 | } 20 | `, 21 | ], 22 | imports: [RouterLink, MatIcon, CodeBlockComponent, CalloutComponent], 23 | }) 24 | export class ConfigurationsComponent {} 25 | -------------------------------------------------------------------------------- /apps/docs/src/pages/guide/migration/from-webpack/from-webpack.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { RouterLink } from '@angular/router'; 3 | import { MatIcon } from '@angular/material/icon'; 4 | import { CodeBlockComponent } from '../../../../ui/code-block/code-block.component'; 5 | import { CalloutComponent } from '../../../../ui/callout/callout.component'; 6 | 7 | @Component({ 8 | preserveWhitespaces: true, 9 | selector: 'app-from-webpack', 10 | templateUrl: './from-webpack.component.html', 11 | styles: [ 12 | ` 13 | :host { 14 | margin: 0 auto; 15 | max-width: 85vw; 16 | @media (min-width: 960px) { 17 | max-width: 70vw; 18 | } 19 | } 20 | `, 21 | ], 22 | imports: [RouterLink, MatIcon, CodeBlockComponent, CalloutComponent], 23 | }) 24 | export class FromWebpackComponent { 25 | nxVersionWithGenerator = '0.0.0-pr-29860-43e1fcb'; 26 | } 27 | -------------------------------------------------------------------------------- /apps/docs/src/server.ts: -------------------------------------------------------------------------------- 1 | // eslint-disable-next-line @nx/enforce-module-boundaries 2 | import { createServer } from '@nx/angular-rsbuild/ssr'; 3 | import bootstrap from './main.server'; 4 | 5 | const server = createServer(bootstrap); 6 | 7 | /** Add your custom server logic here 8 | * 9 | * For example, you can add a custom static file server: 10 | * server.app.use('/static', express.static(staticFolder)); 11 | * Or add additional api routes: 12 | * server.app.get('/api/hello', (req, res) => { 13 | * res.send('Hello World!'); 14 | * }); 15 | * Or add additional middleware: 16 | * server.app.use((req, res, next) => { 17 | * res.send('Hello World!'); 18 | * }); 19 | */ 20 | 21 | server.listen(); 22 | -------------------------------------------------------------------------------- /apps/docs/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../dist/out-tsc", 5 | "types": ["node"] 6 | }, 7 | "files": ["src/main.ts", "src/main.server.ts", "src/server.ts"], 8 | "include": ["src/**/*.d.ts"], 9 | "exclude": [ 10 | "jest.config.ts", 11 | "src/**/*.test.ts", 12 | "src/**/*.spec.ts", 13 | "vite.config.ts", 14 | "vite.config.mts", 15 | "vitest.config.ts", 16 | "vitest.config.mts", 17 | "src/**/*.test.tsx", 18 | "src/**/*.spec.tsx", 19 | "src/**/*.test.js", 20 | "src/**/*.spec.js", 21 | "src/**/*.test.jsx", 22 | "src/**/*.spec.jsx" 23 | ], 24 | "references": [ 25 | { 26 | "path": "../../packages/angular-rsbuild/tsconfig.lib.json" 27 | } 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /apps/docs/tsconfig.editor.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "include": ["src/**/*.ts"], 4 | "compilerOptions": {}, 5 | "exclude": [ 6 | "jest.config.ts", 7 | "src/**/*.test.ts", 8 | "src/**/*.spec.ts", 9 | "vite.config.ts", 10 | "vite.config.mts", 11 | "vitest.config.ts", 12 | "vitest.config.mts", 13 | "src/**/*.test.tsx", 14 | "src/**/*.spec.tsx", 15 | "src/**/*.test.js", 16 | "src/**/*.spec.js", 17 | "src/**/*.test.jsx", 18 | "src/**/*.spec.jsx" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /apps/docs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2022", 4 | "esModuleInterop": true, 5 | "forceConsistentCasingInFileNames": true, 6 | "strict": true, 7 | "noImplicitOverride": true, 8 | "noPropertyAccessFromIndexSignature": true, 9 | "noImplicitReturns": true, 10 | "noFallthroughCasesInSwitch": true 11 | }, 12 | "files": [], 13 | "include": [], 14 | "references": [ 15 | { 16 | "path": "../../packages/angular-rsbuild" 17 | }, 18 | { 19 | "path": "./tsconfig.editor.json" 20 | }, 21 | { 22 | "path": "./tsconfig.app.json" 23 | } 24 | ], 25 | "extends": "../tsconfig.base.json", 26 | "angularCompilerOptions": { 27 | "enableI18nLegacyMessageIdFormat": false, 28 | "strictInjectionParameters": true, 29 | "strictInputAccessModifiers": true, 30 | "strictTemplates": true 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /code-pushup.config.ts: -------------------------------------------------------------------------------- 1 | import { CoreConfig } from '@code-pushup/models'; 2 | import { mergeConfigs } from '@code-pushup/utils'; 3 | import { 4 | baseConfig, 5 | eslintConfig, 6 | } from './tools/reports/code-pushup.preset.config'; 7 | 8 | export default mergeConfigs(baseConfig as CoreConfig, await eslintConfig()); 9 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-css/eslint.config.js: -------------------------------------------------------------------------------- 1 | const nextEslintConfig = require('./eslint.next.config'); 2 | 3 | // 🚨 DO NOT EDIT THIS FILE MANUALLY! 🚨 4 | // Run `pnpm eslint-next/nx` to update or remove this file if all rules pass. 5 | // Add new rules globally to the `eslint.config.js` or locally to the `eslint.next.config.js` file. 6 | // For details, refer to: tools/scripts/eslint-next/README.md 7 | module.exports = [ 8 | ...nextEslintConfig, 9 | { 10 | files: ['**/*'], 11 | rules: { 12 | // ⚠️ Warnings: 1 13 | '@typescript-eslint/no-explicit-any': 'off', // ⚠️ 1 warning 14 | }, 15 | }, 16 | ]; 17 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-css/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-rspack/c7c5b1259eb2ff33e68561eb9025f5dca2fe790d/e2e/fixtures/rsbuild-csr-css/public/favicon.ico -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-css/rsbuild.config.ts: -------------------------------------------------------------------------------- 1 | export default () => { 2 | if (global.NX_GRAPH_CREATION === undefined) { 3 | const { createConfig } = require('@nx/angular-rsbuild'); 4 | return createConfig({ 5 | options: { 6 | browser: './src/main.ts', 7 | inlineStylesExtension: 'css', 8 | outputPath: './build', 9 | define: { 10 | nxAngularRsbuild: '"20.6.2"', 11 | }, 12 | }, 13 | }); 14 | } 15 | return {}; 16 | }; 17 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-css/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-rspack/c7c5b1259eb2ff33e68561eb9025f5dca2fe790d/e2e/fixtures/rsbuild-csr-css/src/app/app.component.css -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-css/src/app/app.component.html: -------------------------------------------------------------------------------- 1 |

@nx/angular-rsbuild v{{ ngAngularRsbuildVersion }}

2 | 3 | 4 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-css/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { RouterModule } from '@angular/router'; 3 | import { NxWelcomeComponent } from './nx-welcome.component'; 4 | 5 | declare const nxAngularRsbuild: string; 6 | 7 | @Component({ 8 | imports: [NxWelcomeComponent, RouterModule], 9 | selector: 'app-root', 10 | templateUrl: './app.component.html', 11 | styleUrl: './app.component.css', 12 | }) 13 | export class AppComponent { 14 | title = 'rsbuild-csr-css'; 15 | ngAngularRsbuildVersion = nxAngularRsbuild; 16 | } 17 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-css/src/app/app.config.ts: -------------------------------------------------------------------------------- 1 | import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core'; 2 | import { provideRouter } from '@angular/router'; 3 | import { appRoutes } from './app.routes'; 4 | 5 | export const appConfig: ApplicationConfig = { 6 | providers: [ 7 | provideZoneChangeDetection({ eventCoalescing: true }), 8 | provideRouter(appRoutes), 9 | ], 10 | }; 11 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-css/src/app/app.routes.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | export const appRoutes: Route[] = []; 4 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-css/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | rsbuild-csr-css 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-css/src/main.ts: -------------------------------------------------------------------------------- 1 | import { bootstrapApplication } from '@angular/platform-browser'; 2 | import { appConfig } from './app/app.config'; 3 | import { AppComponent } from './app/app.component'; 4 | 5 | bootstrapApplication(AppComponent, appConfig).catch((err) => 6 | console.error(err) 7 | ); 8 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-css/src/styles.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-rspack/c7c5b1259eb2ff33e68561eb9025f5dca2fe790d/e2e/fixtures/rsbuild-csr-css/src/styles.css -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-css/test-setup.ts: -------------------------------------------------------------------------------- 1 | import '@analogjs/vitest-angular/setup-zone'; 2 | 3 | import { 4 | BrowserDynamicTestingModule, 5 | platformBrowserDynamicTesting, 6 | } from '@angular/platform-browser-dynamic/testing'; 7 | import { getTestBed } from '@angular/core/testing'; 8 | 9 | getTestBed().initTestEnvironment( 10 | BrowserDynamicTestingModule, 11 | platformBrowserDynamicTesting() 12 | ); 13 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-css/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../../dist/out-tsc", 5 | "types": [] 6 | }, 7 | "files": ["src/main.ts"], 8 | "include": ["src/**/*.d.ts"], 9 | "exclude": [ 10 | "jest.config.ts", 11 | "src/**/*.test.ts", 12 | "src/**/*.spec.ts", 13 | "vite.config.ts", 14 | "vite.config.mts", 15 | "vitest.config.ts", 16 | "vitest.config.mts", 17 | "src/**/*.test.tsx", 18 | "src/**/*.spec.tsx", 19 | "src/**/*.test.js", 20 | "src/**/*.spec.js", 21 | "src/**/*.test.jsx", 22 | "src/**/*.spec.jsx" 23 | ], 24 | "references": [ 25 | { 26 | "path": "../../../packages/angular-rsbuild/tsconfig.lib.json" 27 | } 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-css/tsconfig.editor.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "include": ["src/**/*.ts"], 4 | "compilerOptions": {}, 5 | "exclude": [ 6 | "jest.config.ts", 7 | "src/**/*.test.ts", 8 | "src/**/*.spec.ts", 9 | "vite.config.ts", 10 | "vite.config.mts", 11 | "vitest.config.ts", 12 | "vitest.config.mts", 13 | "src/**/*.test.tsx", 14 | "src/**/*.spec.tsx", 15 | "src/**/*.test.js", 16 | "src/**/*.spec.js", 17 | "src/**/*.test.jsx", 18 | "src/**/*.spec.jsx" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-css/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2022", 4 | "esModuleInterop": true, 5 | "forceConsistentCasingInFileNames": true, 6 | "strict": true, 7 | "noImplicitOverride": true, 8 | "noPropertyAccessFromIndexSignature": true, 9 | "noImplicitReturns": true, 10 | "noFallthroughCasesInSwitch": true 11 | }, 12 | "files": [], 13 | "include": [], 14 | "references": [ 15 | { 16 | "path": "../../../packages/angular-rsbuild" 17 | }, 18 | { 19 | "path": "./tsconfig.editor.json" 20 | }, 21 | { 22 | "path": "./tsconfig.app.json" 23 | }, 24 | { 25 | "path": "./tsconfig.spec.json" 26 | } 27 | ], 28 | "extends": "../../tsconfig.base.json", 29 | "angularCompilerOptions": { 30 | "enableI18nLegacyMessageIdFormat": false, 31 | "strictInjectionParameters": true, 32 | "strictInputAccessModifiers": true, 33 | "strictTemplates": true 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-css/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../../dist/out-tsc", 5 | "types": [ 6 | "vitest/globals", 7 | "vitest/importMeta", 8 | "vite/client", 9 | "node", 10 | "vitest" 11 | ] 12 | }, 13 | "include": [ 14 | "test-setup.ts", 15 | "vite.config.ts", 16 | "vite.config.mts", 17 | "vitest.config.ts", 18 | "vitest.config.mts", 19 | "src/**/*.test.ts", 20 | "src/**/*.spec.ts", 21 | "src/**/*.test.tsx", 22 | "src/**/*.spec.tsx", 23 | "src/**/*.test.js", 24 | "src/**/*.spec.js", 25 | "src/**/*.test.jsx", 26 | "src/**/*.spec.jsx", 27 | "src/**/*.d.ts" 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-css/vite.config.mts: -------------------------------------------------------------------------------- 1 | /// 2 | import { defineConfig } from 'vite'; 3 | import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; 4 | import { nxCopyAssetsPlugin } from '@nx/vite/plugins/nx-copy-assets.plugin'; 5 | import angular from '@analogjs/vite-plugin-angular'; 6 | 7 | export default defineConfig({ 8 | root: __dirname, 9 | cacheDir: '../../node_modules/.vite/rsbuild-csr-css', 10 | plugins: [nxViteTsPaths(), nxCopyAssetsPlugin(['*.md']), angular({}) as any], 11 | }); 12 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-css/vitest.config.mts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | import { resolve } from 'path'; 3 | 4 | export default defineConfig({ 5 | root: __dirname, 6 | cacheDir: '../../node_modules/.vite/rsbuild-csr-css/unit', 7 | plugins: [], 8 | resolve: { 9 | alias: { 10 | '@ng-rspack/testing-utils': resolve(__dirname, '../../testing/utils/src'), 11 | }, 12 | }, 13 | test: { 14 | watch: false, 15 | globals: true, 16 | passWithNoTests: true, 17 | environment: 'node', 18 | include: ['src/**/*.unit.test.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], 19 | reporters: ['default'], 20 | coverage: { 21 | provider: 'v8', 22 | reporter: ['text', 'lcov'], 23 | reportsDirectory: '../../coverage/rsbuild-csr-css/unit', 24 | exclude: ['mocks/**', '**/types.ts', '**/__snapshots__/**'], 25 | }, 26 | }, 27 | }); 28 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-less/eslint.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('../../../eslint.config'); 2 | 3 | module.exports = [ 4 | ...baseConfig, 5 | { 6 | files: ['**/*.ts'], 7 | languageOptions: { 8 | parserOptions: { 9 | projectService: true, 10 | tsconfigRootDir: __dirname, 11 | }, 12 | }, 13 | }, 14 | { 15 | files: ['**/*.json'], 16 | rules: { 17 | '@nx/dependency-checks': [ 18 | 'error', 19 | { 20 | ignoredFiles: [ 21 | '{projectRoot}/eslint.config.{js,cjs,mjs}', 22 | '{projectRoot}/vite.config.{js,ts,mjs,mts}', 23 | '{projectRoot}/vitest.config.{js,ts,mjs,mts}', 24 | ], 25 | ignoredDependencies: ['jsonc-eslint-parser'], 26 | }, 27 | ], 28 | }, 29 | languageOptions: { 30 | parser: require('jsonc-eslint-parser'), 31 | }, 32 | }, 33 | ]; 34 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-less/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-rspack/c7c5b1259eb2ff33e68561eb9025f5dca2fe790d/e2e/fixtures/rsbuild-csr-less/public/favicon.ico -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-less/rsbuild.config.ts: -------------------------------------------------------------------------------- 1 | export default () => { 2 | if (global.NX_GRAPH_CREATION === undefined) { 3 | const { createConfig } = require('@nx/angular-rsbuild'); 4 | return createConfig({ 5 | options: { 6 | browser: './src/main.ts', 7 | styles: ['./src/styles.less'], 8 | inlineStylesExtension: 'less', 9 | devServer: { 10 | port: 8080, 11 | }, 12 | }, 13 | }); 14 | } 15 | return {}; 16 | }; 17 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-less/src/app/app.component.html: -------------------------------------------------------------------------------- 1 |

Hello world!

2 | 3 | 4 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-less/src/app/app.component.less: -------------------------------------------------------------------------------- 1 | // Use LESS variables and assign them to properties 2 | // This is to evaluate the style processor is handling LESS correctly 3 | @bg: black; 4 | @text: white; 5 | 6 | .my-p { 7 | background-color: @bg; 8 | color: @text; 9 | padding: 10px; 10 | } 11 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-less/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { RouterModule } from '@angular/router'; 3 | import { NxWelcomeComponent } from './nx-welcome.component'; 4 | 5 | @Component({ 6 | imports: [NxWelcomeComponent, RouterModule], 7 | selector: 'app-root', 8 | templateUrl: './app.component.html', 9 | styleUrl: './app.component.less', 10 | }) 11 | export class AppComponent { 12 | title = 'rsbuild-csr-css'; 13 | } 14 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-less/src/app/app.config.ts: -------------------------------------------------------------------------------- 1 | import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core'; 2 | import { provideRouter } from '@angular/router'; 3 | import { appRoutes } from './app.routes'; 4 | 5 | export const appConfig: ApplicationConfig = { 6 | providers: [ 7 | provideZoneChangeDetection({ eventCoalescing: true }), 8 | provideRouter(appRoutes), 9 | ], 10 | }; 11 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-less/src/app/app.routes.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | export const appRoutes: Route[] = []; 4 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-less/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | rsbuild-csr-css 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-less/src/main.ts: -------------------------------------------------------------------------------- 1 | import { bootstrapApplication } from '@angular/platform-browser'; 2 | import { appConfig } from './app/app.config'; 3 | import { AppComponent } from './app/app.component'; 4 | 5 | bootstrapApplication(AppComponent, appConfig).catch((err) => 6 | console.error(err) 7 | ); 8 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-less/src/styles.less: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-rspack/c7c5b1259eb2ff33e68561eb9025f5dca2fe790d/e2e/fixtures/rsbuild-csr-less/src/styles.less -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-less/test-setup.ts: -------------------------------------------------------------------------------- 1 | import '@analogjs/vitest-angular/setup-zone'; 2 | 3 | import { 4 | BrowserDynamicTestingModule, 5 | platformBrowserDynamicTesting, 6 | } from '@angular/platform-browser-dynamic/testing'; 7 | import { getTestBed } from '@angular/core/testing'; 8 | 9 | getTestBed().initTestEnvironment( 10 | BrowserDynamicTestingModule, 11 | platformBrowserDynamicTesting() 12 | ); 13 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-less/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../../dist/out-tsc", 5 | "types": [] 6 | }, 7 | "files": ["src/main.ts"], 8 | "include": ["src/**/*.d.ts"], 9 | "exclude": [ 10 | "jest.config.ts", 11 | "src/**/*.test.ts", 12 | "src/**/*.spec.ts", 13 | "vite.config.ts", 14 | "vite.config.mts", 15 | "vitest.config.ts", 16 | "vitest.config.mts", 17 | "src/**/*.test.tsx", 18 | "src/**/*.spec.tsx", 19 | "src/**/*.test.js", 20 | "src/**/*.spec.js", 21 | "src/**/*.test.jsx", 22 | "src/**/*.spec.jsx" 23 | ], 24 | "references": [ 25 | { 26 | "path": "../../../packages/angular-rsbuild/tsconfig.lib.json" 27 | } 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-less/tsconfig.editor.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "include": ["src/**/*.ts"], 4 | "compilerOptions": {}, 5 | "exclude": [ 6 | "jest.config.ts", 7 | "src/**/*.test.ts", 8 | "src/**/*.spec.ts", 9 | "vite.config.ts", 10 | "vite.config.mts", 11 | "vitest.config.ts", 12 | "vitest.config.mts", 13 | "src/**/*.test.tsx", 14 | "src/**/*.spec.tsx", 15 | "src/**/*.test.js", 16 | "src/**/*.spec.js", 17 | "src/**/*.test.jsx", 18 | "src/**/*.spec.jsx" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-less/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2022", 4 | "esModuleInterop": true, 5 | "forceConsistentCasingInFileNames": true, 6 | "strict": true, 7 | "noImplicitOverride": true, 8 | "noPropertyAccessFromIndexSignature": true, 9 | "noImplicitReturns": true, 10 | "noFallthroughCasesInSwitch": true 11 | }, 12 | "files": [], 13 | "include": [], 14 | "references": [ 15 | { 16 | "path": "../../../packages/angular-rsbuild" 17 | }, 18 | { 19 | "path": "./tsconfig.editor.json" 20 | }, 21 | { 22 | "path": "./tsconfig.app.json" 23 | }, 24 | { 25 | "path": "./tsconfig.spec.json" 26 | } 27 | ], 28 | "extends": "../../tsconfig.base.json", 29 | "angularCompilerOptions": { 30 | "enableI18nLegacyMessageIdFormat": false, 31 | "strictInjectionParameters": true, 32 | "strictInputAccessModifiers": true, 33 | "strictTemplates": true 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-less/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../../dist/out-tsc", 5 | "types": [ 6 | "vitest/globals", 7 | "vitest/importMeta", 8 | "vite/client", 9 | "node", 10 | "vitest" 11 | ] 12 | }, 13 | "include": [ 14 | "test-setup.ts", 15 | "vite.config.ts", 16 | "vite.config.mts", 17 | "vitest.config.ts", 18 | "vitest.config.mts", 19 | "src/**/*.test.ts", 20 | "src/**/*.spec.ts", 21 | "src/**/*.test.tsx", 22 | "src/**/*.spec.tsx", 23 | "src/**/*.test.js", 24 | "src/**/*.spec.js", 25 | "src/**/*.test.jsx", 26 | "src/**/*.spec.jsx", 27 | "src/**/*.d.ts" 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-less/vite.config.mts: -------------------------------------------------------------------------------- 1 | /// 2 | import { defineConfig } from 'vite'; 3 | import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; 4 | import { nxCopyAssetsPlugin } from '@nx/vite/plugins/nx-copy-assets.plugin'; 5 | import angular from '@analogjs/vite-plugin-angular'; 6 | 7 | export default defineConfig({ 8 | root: __dirname, 9 | cacheDir: '../../node_modules/.vite/rsbuild-csr-less', 10 | plugins: [ 11 | nxViteTsPaths(), 12 | nxCopyAssetsPlugin(['*.md']), 13 | angular({}) as never, 14 | ], 15 | }); 16 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-less/vitest.config.mts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | import { resolve } from 'path'; 3 | 4 | export default defineConfig({ 5 | root: __dirname, 6 | cacheDir: '../../node_modules/.vite/rsbuild-csr-less/unit', 7 | plugins: [], 8 | resolve: { 9 | alias: { 10 | '@ng-rspack/testing-utils': resolve(__dirname, '../../testing/utils/src'), 11 | }, 12 | }, 13 | test: { 14 | watch: false, 15 | globals: true, 16 | passWithNoTests: true, 17 | environment: 'node', 18 | include: ['src/**/*.unit.test.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], 19 | reporters: ['default'], 20 | coverage: { 21 | provider: 'v8', 22 | reporter: ['text', 'lcov'], 23 | reportsDirectory: '../../coverage/rsbuild-csr-less/unit', 24 | exclude: ['mocks/**', '**/types.ts', '**/__snapshots__/**'], 25 | }, 26 | }, 27 | }); 28 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-scss/eslint.config.js: -------------------------------------------------------------------------------- 1 | const nextEslintConfig = require('./eslint.next.config'); 2 | 3 | // 🚨 DO NOT EDIT THIS FILE MANUALLY! 🚨 4 | // Run `pnpm eslint-next/nx` to update or remove this file if all rules pass. 5 | // Add new rules globally to the `eslint.config.js` or locally to the `eslint.next.config.js` file. 6 | // For details, refer to: tools/scripts/eslint-next/README.md 7 | module.exports = [ 8 | ...nextEslintConfig, 9 | { 10 | files: ['**/*'], 11 | rules: { 12 | // ⚠️ Warnings: 1 13 | '@typescript-eslint/no-explicit-any': 'off', // ⚠️ 1 warning 14 | }, 15 | }, 16 | ]; 17 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-scss/eslint.next.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('../../../eslint.config'); 2 | 3 | module.exports = [ 4 | ...baseConfig, 5 | { 6 | files: ['**/*.ts'], 7 | languageOptions: { 8 | parserOptions: { 9 | projectService: true, 10 | tsconfigRootDir: __dirname, 11 | }, 12 | }, 13 | }, 14 | { 15 | files: ['**/*'], 16 | rules: {}, 17 | }, 18 | ]; 19 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-scss/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "devDependencies": { 4 | "@nx/angular-rsbuild": "workspace:*" 5 | }, 6 | "nx": { 7 | "name": "rsbuild-csr-scss", 8 | "projectType": "application", 9 | "prefix": "app", 10 | "sourceRoot": "e2e/fixtures/rsbuild-csr-css/src", 11 | "tags": [], 12 | "targets": { 13 | "extract-i18n": { 14 | "executor": "@angular-devkit/build-angular:extract-i18n", 15 | "options": { 16 | "buildTarget": "rsbuild-csr-scss:build" 17 | } 18 | }, 19 | "serve-static": { 20 | "executor": "@nx/web:file-server", 21 | "options": { 22 | "buildTarget": "rsbuild-csr-scss:build", 23 | "port": 4200, 24 | "staticFilePath": "dist/rsbuild-csr-scss/browser", 25 | "spa": true 26 | } 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-scss/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-rspack/c7c5b1259eb2ff33e68561eb9025f5dca2fe790d/e2e/fixtures/rsbuild-csr-scss/public/favicon.ico -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-scss/rsbuild.config.ts: -------------------------------------------------------------------------------- 1 | export default () => { 2 | if (global.NX_GRAPH_CREATION === undefined) { 3 | const { createConfig } = require('@nx/angular-rsbuild'); 4 | return createConfig({ 5 | options: { 6 | browser: './src/main.ts', 7 | inlineStylesExtension: 'scss', 8 | styles: ['./src/styles.scss'], 9 | }, 10 | }); 11 | } 12 | return {}; 13 | }; 14 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-scss/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-scss/src/app/app.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-rspack/c7c5b1259eb2ff33e68561eb9025f5dca2fe790d/e2e/fixtures/rsbuild-csr-scss/src/app/app.component.scss -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-scss/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { RouterModule } from '@angular/router'; 3 | import { NxWelcomeComponent } from './nx-welcome.component'; 4 | 5 | @Component({ 6 | imports: [NxWelcomeComponent, RouterModule], 7 | selector: 'app-root', 8 | templateUrl: './app.component.html', 9 | styleUrl: './app.component.scss', 10 | }) 11 | export class AppComponent { 12 | title = 'rsbuild-csr-scss'; 13 | } 14 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-scss/src/app/app.config.ts: -------------------------------------------------------------------------------- 1 | import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core'; 2 | import { provideRouter } from '@angular/router'; 3 | import { appRoutes } from './app.routes'; 4 | 5 | export const appConfig: ApplicationConfig = { 6 | providers: [ 7 | provideZoneChangeDetection({ eventCoalescing: true }), 8 | provideRouter(appRoutes), 9 | ], 10 | }; 11 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-scss/src/app/app.routes.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | export const appRoutes: Route[] = []; 4 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-scss/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | rsbuild-csr-scss 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-scss/src/main.ts: -------------------------------------------------------------------------------- 1 | import { bootstrapApplication } from '@angular/platform-browser'; 2 | import { appConfig } from './app/app.config'; 3 | import { AppComponent } from './app/app.component'; 4 | 5 | bootstrapApplication(AppComponent, appConfig).catch((err) => 6 | console.error(err) 7 | ); 8 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-scss/src/styles.scss: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-scss/test-setup.ts: -------------------------------------------------------------------------------- 1 | import '@analogjs/vitest-angular/setup-zone'; 2 | 3 | import { 4 | BrowserDynamicTestingModule, 5 | platformBrowserDynamicTesting, 6 | } from '@angular/platform-browser-dynamic/testing'; 7 | import { getTestBed } from '@angular/core/testing'; 8 | 9 | getTestBed().initTestEnvironment( 10 | BrowserDynamicTestingModule, 11 | platformBrowserDynamicTesting() 12 | ); 13 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-scss/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../../dist/out-tsc", 5 | "types": [] 6 | }, 7 | "files": ["src/main.ts"], 8 | "include": ["src/**/*.d.ts"], 9 | "exclude": [ 10 | "jest.config.ts", 11 | "src/**/*.test.ts", 12 | "src/**/*.spec.ts", 13 | "vite.config.ts", 14 | "vite.config.mts", 15 | "vitest.config.ts", 16 | "vitest.config.mts", 17 | "src/**/*.test.tsx", 18 | "src/**/*.spec.tsx", 19 | "src/**/*.test.js", 20 | "src/**/*.spec.js", 21 | "src/**/*.test.jsx", 22 | "src/**/*.spec.jsx" 23 | ], 24 | "references": [ 25 | { 26 | "path": "../../../packages/angular-rsbuild/tsconfig.lib.json" 27 | } 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-scss/tsconfig.editor.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "include": ["src/**/*.ts"], 4 | "compilerOptions": {}, 5 | "exclude": [ 6 | "jest.config.ts", 7 | "src/**/*.test.ts", 8 | "src/**/*.spec.ts", 9 | "vite.config.ts", 10 | "vite.config.mts", 11 | "vitest.config.ts", 12 | "vitest.config.mts", 13 | "src/**/*.test.tsx", 14 | "src/**/*.spec.tsx", 15 | "src/**/*.test.js", 16 | "src/**/*.spec.js", 17 | "src/**/*.test.jsx", 18 | "src/**/*.spec.jsx" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-scss/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2022", 4 | "esModuleInterop": true, 5 | "forceConsistentCasingInFileNames": true, 6 | "strict": true, 7 | "noImplicitOverride": true, 8 | "noPropertyAccessFromIndexSignature": true, 9 | "noImplicitReturns": true, 10 | "noFallthroughCasesInSwitch": true 11 | }, 12 | "files": [], 13 | "include": [], 14 | "references": [ 15 | { 16 | "path": "../../../packages/angular-rsbuild" 17 | }, 18 | { 19 | "path": "./tsconfig.editor.json" 20 | }, 21 | { 22 | "path": "./tsconfig.app.json" 23 | }, 24 | { 25 | "path": "./tsconfig.spec.json" 26 | } 27 | ], 28 | "extends": "../../tsconfig.base.json", 29 | "angularCompilerOptions": { 30 | "enableI18nLegacyMessageIdFormat": false, 31 | "strictInjectionParameters": true, 32 | "strictInputAccessModifiers": true, 33 | "strictTemplates": true 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-scss/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../../dist/out-tsc", 5 | "types": [ 6 | "vitest/globals", 7 | "vitest/importMeta", 8 | "vite/client", 9 | "node", 10 | "vitest" 11 | ] 12 | }, 13 | "include": [ 14 | "test-setup.ts", 15 | "vite.config.ts", 16 | "vite.config.mts", 17 | "vitest.config.ts", 18 | "vitest.config.mts", 19 | "src/**/*.test.ts", 20 | "src/**/*.spec.ts", 21 | "src/**/*.test.tsx", 22 | "src/**/*.spec.tsx", 23 | "src/**/*.test.js", 24 | "src/**/*.spec.js", 25 | "src/**/*.test.jsx", 26 | "src/**/*.spec.jsx", 27 | "src/**/*.d.ts" 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-scss/vite.config.mts: -------------------------------------------------------------------------------- 1 | /// 2 | import { defineConfig } from 'vite'; 3 | import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; 4 | import { nxCopyAssetsPlugin } from '@nx/vite/plugins/nx-copy-assets.plugin'; 5 | import angular from '@analogjs/vite-plugin-angular'; 6 | 7 | export default defineConfig({ 8 | root: __dirname, 9 | cacheDir: '../../../node_modules/.vite/rsbuild-csr-scss', 10 | plugins: [nxViteTsPaths(), nxCopyAssetsPlugin(['*.md']), angular({}) as any], 11 | }); 12 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-csr-scss/vitest.config.mts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | import { resolve } from 'path'; 3 | 4 | export default defineConfig({ 5 | root: __dirname, 6 | cacheDir: '../../../node_modules/.vite/rsbuild-csr-scss/unit', 7 | plugins: [], 8 | resolve: { 9 | alias: { 10 | '@ng-rspack/testing-utils': resolve( 11 | __dirname, 12 | '../../../testing/utils/src' 13 | ), 14 | }, 15 | }, 16 | test: { 17 | watch: false, 18 | globals: true, 19 | passWithNoTests: true, 20 | environment: 'node', 21 | include: ['src/**/*.unit.test.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], 22 | reporters: ['default'], 23 | coverage: { 24 | provider: 'v8', 25 | reporter: ['text', 'lcov'], 26 | reportsDirectory: '../../../coverage/rsbuild-csr-scss/unit', 27 | exclude: ['mocks/**', '**/types.ts', '**/__snapshots__/**'], 28 | }, 29 | }, 30 | }); 31 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-ssr-css/eslint.config.js: -------------------------------------------------------------------------------- 1 | const nextEslintConfig = require('./eslint.next.config'); 2 | 3 | // 🚨 DO NOT EDIT THIS FILE MANUALLY! 🚨 4 | // Run `pnpm eslint-next/nx` to update or remove this file if all rules pass. 5 | // Add new rules globally to the `eslint.config.js` or locally to the `eslint.next.config.js` file. 6 | // For details, refer to: tools/scripts/eslint-next/README.md 7 | module.exports = [ 8 | ...nextEslintConfig, 9 | { 10 | files: ['**/*'], 11 | rules: { 12 | // ⚠️ Warnings: 1 13 | '@typescript-eslint/no-explicit-any': 'off', // ⚠️ 1 warning 14 | }, 15 | }, 16 | ]; 17 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-ssr-css/eslint.next.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('../../../eslint.config'); 2 | 3 | module.exports = [ 4 | ...baseConfig, 5 | { 6 | files: ['**/*.ts'], 7 | languageOptions: { 8 | parserOptions: { 9 | projectService: true, 10 | tsconfigRootDir: __dirname, 11 | }, 12 | }, 13 | }, 14 | { 15 | files: ['**/*'], 16 | rules: {}, 17 | }, 18 | ]; 19 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-ssr-css/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "devDependencies": { 4 | "@nx/angular-rsbuild": "workspace:*" 5 | }, 6 | "nx": { 7 | "name": "rsbuild-ssr-css", 8 | "projectType": "application", 9 | "prefix": "app", 10 | "sourceRoot": "e2e/fixtures/rsbuild-ssr-css/src", 11 | "tags": [], 12 | "targets": { 13 | "build": { 14 | "parallelism": false 15 | }, 16 | "start": { 17 | "dependsOn": [ 18 | "build" 19 | ], 20 | "command": "node dist/server/server.js", 21 | "options": { 22 | "cwd": "apps/rsbuild/ssr/css" 23 | } 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-ssr-css/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-rspack/c7c5b1259eb2ff33e68561eb9025f5dca2fe790d/e2e/fixtures/rsbuild-ssr-css/public/favicon.ico -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-ssr-css/rsbuild.config.ts: -------------------------------------------------------------------------------- 1 | export default () => { 2 | if (global.NX_GRAPH_CREATION === undefined) { 3 | const { createConfig } = require('@nx/angular-rsbuild'); 4 | return createConfig({ 5 | options: { 6 | browser: './src/main.ts', 7 | server: './src/main.server.ts', 8 | ssr: { entry: './src/server.ts' }, 9 | inlineStylesExtension: 'css', 10 | }, 11 | }); 12 | } 13 | return {}; 14 | }; 15 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-ssr-css/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-rspack/c7c5b1259eb2ff33e68561eb9025f5dca2fe790d/e2e/fixtures/rsbuild-ssr-css/src/app/app.component.css -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-ssr-css/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-ssr-css/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { RouterModule } from '@angular/router'; 3 | import { NxWelcomeComponent } from './nx-welcome.component'; 4 | 5 | @Component({ 6 | imports: [NxWelcomeComponent, RouterModule], 7 | selector: 'app-root', 8 | templateUrl: './app.component.html', 9 | styleUrl: './app.component.css', 10 | }) 11 | export class AppComponent { 12 | title = 'rsbuild-ssr-css'; 13 | } 14 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-ssr-css/src/app/app.config.server.ts: -------------------------------------------------------------------------------- 1 | import { mergeApplicationConfig, ApplicationConfig } from '@angular/core'; 2 | import { provideServerRendering } from '@angular/ssr'; 3 | import { appConfig } from './app.config'; 4 | 5 | const serverConfig: ApplicationConfig = { 6 | providers: [provideServerRendering()], 7 | }; 8 | 9 | export const config = mergeApplicationConfig(appConfig, serverConfig); 10 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-ssr-css/src/app/app.config.ts: -------------------------------------------------------------------------------- 1 | import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core'; 2 | import { provideRouter } from '@angular/router'; 3 | import { appRoutes } from './app.routes'; 4 | import { 5 | provideClientHydration, 6 | withEventReplay, 7 | } from '@angular/platform-browser'; 8 | 9 | export const appConfig: ApplicationConfig = { 10 | providers: [ 11 | provideClientHydration(withEventReplay()), 12 | provideZoneChangeDetection({ eventCoalescing: true }), 13 | provideRouter(appRoutes), 14 | ], 15 | }; 16 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-ssr-css/src/app/app.routes.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | export const appRoutes: Route[] = []; 4 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-ssr-css/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | rsbuild-ssr-css 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-ssr-css/src/main.server.ts: -------------------------------------------------------------------------------- 1 | import { bootstrapApplication } from '@angular/platform-browser'; 2 | import { AppComponent } from './app/app.component'; 3 | import { config } from './app/app.config.server'; 4 | 5 | const bootstrap = () => bootstrapApplication(AppComponent, config); 6 | 7 | export default bootstrap; 8 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-ssr-css/src/main.ts: -------------------------------------------------------------------------------- 1 | import { bootstrapApplication } from '@angular/platform-browser'; 2 | import { appConfig } from './app/app.config'; 3 | import { AppComponent } from './app/app.component'; 4 | 5 | bootstrapApplication(AppComponent, appConfig).catch((err) => 6 | console.error(err) 7 | ); 8 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-ssr-css/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-ssr-css/test-setup.ts: -------------------------------------------------------------------------------- 1 | import '@analogjs/vitest-angular/setup-zone'; 2 | 3 | import { 4 | BrowserDynamicTestingModule, 5 | platformBrowserDynamicTesting, 6 | } from '@angular/platform-browser-dynamic/testing'; 7 | import { getTestBed } from '@angular/core/testing'; 8 | 9 | getTestBed().initTestEnvironment( 10 | BrowserDynamicTestingModule, 11 | platformBrowserDynamicTesting() 12 | ); 13 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-ssr-css/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../../dist/out-tsc", 5 | "types": ["node"] 6 | }, 7 | "files": ["src/main.ts", "src/main.server.ts", "src/server.ts"], 8 | "include": ["src/**/*.d.ts"], 9 | "exclude": [ 10 | "jest.config.ts", 11 | "src/**/*.test.ts", 12 | "src/**/*.spec.ts", 13 | "vite.config.ts", 14 | "vite.config.mts", 15 | "vitest.config.ts", 16 | "vitest.config.mts", 17 | "src/**/*.test.tsx", 18 | "src/**/*.spec.tsx", 19 | "src/**/*.test.js", 20 | "src/**/*.spec.js", 21 | "src/**/*.test.jsx", 22 | "src/**/*.spec.jsx" 23 | ], 24 | "references": [ 25 | { 26 | "path": "../../../packages/angular-rsbuild/tsconfig.lib.json" 27 | } 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-ssr-css/tsconfig.editor.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "include": ["src/**/*.ts"], 4 | "compilerOptions": {}, 5 | "exclude": [ 6 | "jest.config.ts", 7 | "src/**/*.test.ts", 8 | "src/**/*.spec.ts", 9 | "vite.config.ts", 10 | "vite.config.mts", 11 | "vitest.config.ts", 12 | "vitest.config.mts", 13 | "src/**/*.test.tsx", 14 | "src/**/*.spec.tsx", 15 | "src/**/*.test.js", 16 | "src/**/*.spec.js", 17 | "src/**/*.test.jsx", 18 | "src/**/*.spec.jsx" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-ssr-css/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../../dist/out-tsc", 5 | "types": [ 6 | "vitest/globals", 7 | "vitest/importMeta", 8 | "vite/client", 9 | "node", 10 | "vitest" 11 | ] 12 | }, 13 | "include": [ 14 | "test-setup.ts", 15 | "vite.config.ts", 16 | "vite.config.mts", 17 | "vitest.config.ts", 18 | "vitest.config.mts", 19 | "src/**/*.test.ts", 20 | "src/**/*.spec.ts", 21 | "src/**/*.test.tsx", 22 | "src/**/*.spec.tsx", 23 | "src/**/*.test.js", 24 | "src/**/*.spec.js", 25 | "src/**/*.test.jsx", 26 | "src/**/*.spec.jsx", 27 | "src/**/*.d.ts" 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-ssr-css/vite.config.mts: -------------------------------------------------------------------------------- 1 | /// 2 | import { defineConfig } from 'vite'; 3 | import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; 4 | import { nxCopyAssetsPlugin } from '@nx/vite/plugins/nx-copy-assets.plugin'; 5 | import angular from '@analogjs/vite-plugin-angular'; 6 | 7 | export default defineConfig({ 8 | root: __dirname, 9 | cacheDir: '../../../node_modules/.vite/rsbuild-ssr-css', 10 | plugins: [nxViteTsPaths(), nxCopyAssetsPlugin(['*.md']), angular({}) as any], 11 | }); 12 | -------------------------------------------------------------------------------- /e2e/fixtures/rsbuild-ssr-css/vitest.config.mts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | import { resolve } from 'path'; 3 | 4 | export default defineConfig({ 5 | root: __dirname, 6 | cacheDir: '../../../node_modules/.vite/rsbuild-ssr-css/unit', 7 | plugins: [], 8 | resolve: { 9 | alias: { 10 | '@ng-rspack/testing-utils': resolve( 11 | __dirname, 12 | '../../../testing/utils/src' 13 | ), 14 | }, 15 | }, 16 | test: { 17 | watch: false, 18 | globals: true, 19 | passWithNoTests: true, 20 | environment: 'node', 21 | include: ['src/**/*.unit.test.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], 22 | reporters: ['default'], 23 | coverage: { 24 | provider: 'v8', 25 | reporter: ['text', 'lcov'], 26 | reportsDirectory: '../../../coverage/rsbuild-ssr-css/unit', 27 | exclude: ['mocks/**', '**/types.ts', '**/__snapshots__/**'], 28 | }, 29 | }, 30 | }); 31 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-appshell-css/eslint.next.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('../../../eslint.config'); 2 | 3 | module.exports = [ 4 | ...baseConfig, 5 | { 6 | files: ['**/*.ts'], 7 | languageOptions: { 8 | parserOptions: { 9 | projectService: true, 10 | tsconfigRootDir: __dirname, 11 | }, 12 | }, 13 | }, 14 | { 15 | files: ['**/*'], 16 | rules: {}, 17 | }, 18 | ]; 19 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-appshell-css/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rspack-appshell-css", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": {}, 6 | "dependencies": { 7 | "@nx/angular-rspack": "workspace:*" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-appshell-css/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-rspack/c7c5b1259eb2ff33e68561eb9025f5dca2fe790d/e2e/fixtures/rspack-appshell-css/public/favicon.ico -------------------------------------------------------------------------------- /e2e/fixtures/rspack-appshell-css/rspack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = () => { 2 | if (global.NX_GRAPH_CREATION === undefined) { 3 | const { createConfig } = require('@nx/angular-rspack'); 4 | return createConfig( 5 | { 6 | options: { 7 | root: __dirname, 8 | browser: './src/main.ts', 9 | index: './src/index.html', 10 | server: './src/main.server.ts', 11 | polyfills: ['zone.js'], 12 | ssr: { entry: './src/server.ts' }, 13 | appShell: true, 14 | assets: [ 15 | { 16 | glob: '**/*', 17 | input: './public', 18 | }, 19 | ], 20 | }, 21 | }, 22 | { 23 | development: { 24 | options: { 25 | optimization: false, 26 | }, 27 | }, 28 | } 29 | ); 30 | } 31 | return {}; 32 | }; 33 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-appshell-css/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-rspack/c7c5b1259eb2ff33e68561eb9025f5dca2fe790d/e2e/fixtures/rspack-appshell-css/src/app/app.component.css -------------------------------------------------------------------------------- /e2e/fixtures/rspack-appshell-css/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | @defer (hydrate on viewport) { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-appshell-css/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { RouterModule } from '@angular/router'; 3 | import { NxWelcomeComponent } from './nx-welcome.component'; 4 | import { FooComponent } from './foo.component'; 5 | 6 | @Component({ 7 | imports: [NxWelcomeComponent, RouterModule, FooComponent], 8 | selector: 'app-root', 9 | templateUrl: './app.component.html', 10 | styleUrl: './app.component.css', 11 | }) 12 | export class AppComponent { 13 | title = 'rspack-ssg-css'; 14 | } 15 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-appshell-css/src/app/app.config.server.ts: -------------------------------------------------------------------------------- 1 | import { mergeApplicationConfig, ApplicationConfig } from '@angular/core'; 2 | import { provideServerRendering } from '@angular/ssr'; 3 | import { appConfig } from './app.config'; 4 | 5 | const serverConfig: ApplicationConfig = { 6 | providers: [provideServerRendering()], 7 | }; 8 | 9 | export const config = mergeApplicationConfig(appConfig, serverConfig); 10 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-appshell-css/src/app/app.config.ts: -------------------------------------------------------------------------------- 1 | import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core'; 2 | import { provideRouter } from '@angular/router'; 3 | import { appRoutes } from './app.routes'; 4 | import { 5 | provideClientHydration, 6 | withEventReplay, 7 | withIncrementalHydration, 8 | } from '@angular/platform-browser'; 9 | 10 | export const appConfig: ApplicationConfig = { 11 | providers: [ 12 | provideClientHydration(withEventReplay(), withIncrementalHydration()), 13 | provideZoneChangeDetection({ eventCoalescing: true }), 14 | provideRouter(appRoutes), 15 | ], 16 | }; 17 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-appshell-css/src/app/app.routes.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | export const appRoutes: Route[] = [ 4 | { 5 | path: 'bar', 6 | loadComponent: () => 7 | import('./bar/bar.component').then((m) => m.BarComponent), 8 | }, 9 | { 10 | path: 'nested', 11 | loadChildren: () => 12 | import('./nested/nested.routes').then((m) => m.nestedRoutes), 13 | }, 14 | ]; 15 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-appshell-css/src/app/bar/bar.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-bar', 5 | template: `

Bar

`, 6 | styles: [], 7 | }) 8 | export class BarComponent {} 9 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-appshell-css/src/app/foo.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-foo', 5 | template: '
Foo
', 6 | }) 7 | export class FooComponent {} 8 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-appshell-css/src/app/nested/child-a/child-a.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-child-a', 5 | template: `

Child A

`, 6 | styles: [], 7 | }) 8 | export class ChildAComponent {} 9 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-appshell-css/src/app/nested/child-b/child-b.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-child-a', 5 | template: `

Child B

`, 6 | styles: [], 7 | }) 8 | export class ChildBComponent {} 9 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-appshell-css/src/app/nested/nested.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { RouterLink, RouterOutlet } from '@angular/router'; 3 | 4 | @Component({ 5 | imports: [RouterOutlet, RouterLink], 6 | selector: 'app-nested', 7 | template: `

Nested

8 | 9 | 13 | 14 | `, 15 | styles: [], 16 | }) 17 | export class NestedComponent {} 18 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-appshell-css/src/app/nested/nested.routes.ts: -------------------------------------------------------------------------------- 1 | import { NestedComponent } from './nested.component'; 2 | 3 | export const nestedRoutes = [ 4 | { 5 | path: '', 6 | component: NestedComponent, 7 | children: [ 8 | { 9 | path: 'child-a', 10 | loadComponent: () => 11 | import('./child-a/child-a.component').then((m) => m.ChildAComponent), 12 | }, 13 | { 14 | path: 'child-b', 15 | loadComponent: () => 16 | import('./child-b/child-b.component').then((m) => m.ChildBComponent), 17 | }, 18 | ], 19 | }, 20 | ]; 21 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-appshell-css/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | rspack-ssr-css 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-appshell-css/src/main.server.ts: -------------------------------------------------------------------------------- 1 | import { bootstrapApplication } from '@angular/platform-browser'; 2 | import { AppComponent } from './app/app.component'; 3 | import { config } from './app/app.config.server'; 4 | 5 | const bootstrap = () => bootstrapApplication(AppComponent, config); 6 | 7 | export default bootstrap; 8 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-appshell-css/src/main.ts: -------------------------------------------------------------------------------- 1 | import { bootstrapApplication } from '@angular/platform-browser'; 2 | import { appConfig } from './app/app.config'; 3 | import { AppComponent } from './app/app.component'; 4 | 5 | bootstrapApplication(AppComponent, appConfig).catch((err) => 6 | console.error(err) 7 | ); 8 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-appshell-css/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-appshell-css/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../dist/out-tsc", 5 | "types": ["node"] 6 | }, 7 | "files": ["src/main.ts", "src/main.server.ts", "src/server.ts"], 8 | "include": ["src/**/*.d.ts"], 9 | "exclude": [ 10 | "jest.config.ts", 11 | "src/**/*.test.ts", 12 | "src/**/*.spec.ts", 13 | "vite.config.ts", 14 | "vite.config.mts", 15 | "vitest.config.ts", 16 | "vitest.config.mts", 17 | "src/**/*.test.tsx", 18 | "src/**/*.spec.tsx", 19 | "src/**/*.test.js", 20 | "src/**/*.spec.js", 21 | "src/**/*.test.jsx", 22 | "src/**/*.spec.jsx" 23 | ], 24 | "references": [ 25 | { 26 | "path": "../../../packages/angular-rspack/tsconfig.lib.json" 27 | } 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-appshell-css/tsconfig.editor.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "include": ["src/**/*.ts"], 4 | "compilerOptions": {}, 5 | "exclude": [ 6 | "jest.config.ts", 7 | "src/**/*.test.ts", 8 | "src/**/*.spec.ts", 9 | "vite.config.ts", 10 | "vite.config.mts", 11 | "vitest.config.ts", 12 | "vitest.config.mts", 13 | "src/**/*.test.tsx", 14 | "src/**/*.spec.tsx", 15 | "src/**/*.test.js", 16 | "src/**/*.spec.js", 17 | "src/**/*.test.jsx", 18 | "src/**/*.spec.jsx" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-appshell-css/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2022", 4 | "esModuleInterop": true, 5 | "forceConsistentCasingInFileNames": true, 6 | "strict": true, 7 | "noImplicitOverride": true, 8 | "noPropertyAccessFromIndexSignature": true, 9 | "noImplicitReturns": true, 10 | "noFallthroughCasesInSwitch": true, 11 | "moduleResolution": "bundler" 12 | }, 13 | "files": [], 14 | "include": [], 15 | "references": [ 16 | { 17 | "path": "../../../packages/angular-rspack" 18 | }, 19 | { 20 | "path": "./tsconfig.editor.json" 21 | }, 22 | { 23 | "path": "./tsconfig.app.json" 24 | } 25 | ], 26 | "extends": "../../tsconfig.base.json", 27 | "angularCompilerOptions": { 28 | "enableI18nLegacyMessageIdFormat": false, 29 | "strictInjectionParameters": true, 30 | "strictInputAccessModifiers": true, 31 | "strictTemplates": true 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-css/eslint.next.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('../../../eslint.config'); 2 | 3 | module.exports = [ 4 | ...baseConfig, 5 | { 6 | files: ['**/*.ts'], 7 | languageOptions: { 8 | parserOptions: { 9 | projectService: true, 10 | tsconfigRootDir: __dirname, 11 | }, 12 | }, 13 | }, 14 | { 15 | files: ['**/*'], 16 | rules: {}, 17 | }, 18 | ]; 19 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-css/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rspack-csr-css", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": {}, 6 | "dependencies": { 7 | "@nx/angular-rspack": "workspace:*" 8 | }, 9 | "nx": { 10 | "targets": { 11 | "serve-api": { 12 | "continuous": true, 13 | "command": "node ./src/api.mjs", 14 | "options": { 15 | "cwd": "e2e/fixtures/rspack-csr-css" 16 | } 17 | }, 18 | "serve": { 19 | "dependsOn": [ 20 | "serve-api" 21 | ] 22 | } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-css/proxy.conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "/api": { 3 | "target": "http://localhost:3000", 4 | "secure": false, 5 | "changeOrigin": true 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-css/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-rspack/c7c5b1259eb2ff33e68561eb9025f5dca2fe790d/e2e/fixtures/rspack-csr-css/public/favicon.ico -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-css/scripts/internal-shared-script.js: -------------------------------------------------------------------------------- 1 | console.log('internal-shared-script'); 2 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-css/scripts/non-initial-script.js: -------------------------------------------------------------------------------- 1 | console.log('non-initial-script'); 2 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-css/scripts/script1.js: -------------------------------------------------------------------------------- 1 | console.log('script1'); 2 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-css/scripts/script2.js: -------------------------------------------------------------------------------- 1 | console.log('script2'); 2 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-css/src/api.mjs: -------------------------------------------------------------------------------- 1 | import http from 'node:http'; 2 | 3 | const server = http.createServer((req, res) => { 4 | const name = req.url?.split('/api/')[1] || 'stranger'; 5 | 6 | res.writeHead(200, { 7 | 'Content-Type': 'application/json', 8 | 'Access-Control-Allow-Origin': '*', 9 | }); 10 | res.end(JSON.stringify({ message: `Hello ${name}!` })); 11 | }); 12 | 13 | server.listen(3000, () => { 14 | console.log('Server running at http://localhost:3000'); 15 | }); 16 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-css/src/app/api.service.ts: -------------------------------------------------------------------------------- 1 | import { HttpClient } from '@angular/common/http'; 2 | import { Injectable } from '@angular/core'; 3 | import { map, type Observable } from 'rxjs'; 4 | 5 | @Injectable({ providedIn: 'root' }) 6 | export class ApiService { 7 | constructor(private readonly http: HttpClient) {} 8 | 9 | getGreeting(name: string): Observable { 10 | return this.http 11 | .get<{ message: string }>(`/api/${name}`) 12 | .pipe(map((response) => response.message)); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-css/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | .nx-angular-rspack { 2 | color: green; 3 | } 4 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-css/src/app/app.component.html: -------------------------------------------------------------------------------- 1 |

@nx/angular-rspack v{{ nxAngularRspackVersion }}

2 |

{{ greeting$ | async }}

3 |

 

4 |

Nx Angular Rspack CSS Testing

5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-css/src/app/app.config.ts: -------------------------------------------------------------------------------- 1 | import { provideHttpClient, withFetch } from '@angular/common/http'; 2 | import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core'; 3 | import { provideRouter } from '@angular/router'; 4 | import { appRoutes } from './app.routes'; 5 | 6 | export const appConfig: ApplicationConfig = { 7 | providers: [ 8 | provideZoneChangeDetection({ eventCoalescing: true }), 9 | provideRouter(appRoutes), 10 | provideHttpClient(withFetch()), 11 | ], 12 | }; 13 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-css/src/app/app.routes.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | export const appRoutes: Route[] = []; 4 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-css/src/app/app.worker.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | addEventListener('message', ({ data }) => { 4 | const response = `worker response to ${data}`; 5 | postMessage(response); 6 | }); 7 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-css/src/app/scss-inline-test.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-scss-inline-test', 5 | template: ` 6 |
7 |

SCSS Inline Test

8 |

This is a test of SCSS Inline

9 |
10 | `, 11 | styles: [ 12 | ` 13 | .content { 14 | display: flex; 15 | min-height: 100vh; 16 | line-height: 1.1; 17 | text-align: center; 18 | flex-direction: column; 19 | justify-content: center; 20 | } 21 | 22 | .content h1 { 23 | font-size: 3.6rem; 24 | font-weight: 700; 25 | color: red; 26 | } 27 | 28 | .content p { 29 | font-size: 1.2rem; 30 | font-weight: 400; 31 | opacity: 0.5; 32 | } 33 | `, 34 | ], 35 | }) 36 | export class ScssInlineTestComponent {} 37 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-css/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | rspack-csr-css 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-css/src/main.ts: -------------------------------------------------------------------------------- 1 | import { bootstrapApplication } from '@angular/platform-browser'; 2 | import { appConfig } from './app/app.config'; 3 | import { AppComponent } from './app/app.component'; 4 | 5 | const version = await import('../package.json').then((m) => m.default.version); 6 | console.log('version', version); 7 | bootstrapApplication(AppComponent, appConfig).catch((err) => 8 | console.error(err) 9 | ); 10 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-css/src/styles.css: -------------------------------------------------------------------------------- 1 | div { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-css/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../../dist/out-tsc", 5 | "types": [] 6 | }, 7 | "files": ["src/main.ts"], 8 | "include": ["src/**/*.d.ts"], 9 | "exclude": [ 10 | "jest.config.ts", 11 | "src/**/*.test.ts", 12 | "src/**/*.spec.ts", 13 | "vite.config.ts", 14 | "vite.config.mts", 15 | "vitest.config.ts", 16 | "vitest.config.mts", 17 | "src/**/*.test.tsx", 18 | "src/**/*.spec.tsx", 19 | "src/**/*.test.js", 20 | "src/**/*.spec.js", 21 | "src/**/*.test.jsx", 22 | "src/**/*.spec.jsx" 23 | ], 24 | "references": [ 25 | { 26 | "path": "../../../packages/angular-rspack/tsconfig.lib.json" 27 | } 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-css/tsconfig.editor.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "include": ["src/**/*.ts", "src/api.mjs"], 4 | "compilerOptions": {}, 5 | "exclude": [ 6 | "jest.config.ts", 7 | "src/**/*.test.ts", 8 | "src/**/*.spec.ts", 9 | "vite.config.ts", 10 | "vite.config.mts", 11 | "vitest.config.ts", 12 | "vitest.config.mts", 13 | "src/**/*.test.tsx", 14 | "src/**/*.spec.tsx", 15 | "src/**/*.test.js", 16 | "src/**/*.spec.js", 17 | "src/**/*.test.jsx", 18 | "src/**/*.spec.jsx" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-css/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2022", 4 | "esModuleInterop": true, 5 | "forceConsistentCasingInFileNames": true, 6 | "strict": true, 7 | "noImplicitOverride": true, 8 | "noPropertyAccessFromIndexSignature": true, 9 | "noImplicitReturns": true, 10 | "noFallthroughCasesInSwitch": true, 11 | "resolveJsonModule": true 12 | }, 13 | "files": [], 14 | "include": [], 15 | "references": [ 16 | { 17 | "path": "../../../packages/angular-rspack" 18 | }, 19 | { 20 | "path": "./tsconfig.editor.json" 21 | }, 22 | { 23 | "path": "./tsconfig.app.json" 24 | } 25 | ], 26 | "extends": "../../tsconfig.base.json", 27 | "angularCompilerOptions": { 28 | "enableI18nLegacyMessageIdFormat": false, 29 | "strictInjectionParameters": true, 30 | "strictInputAccessModifiers": true, 31 | "strictTemplates": true 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-i18n/eslint.next.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('../../../eslint.config'); 2 | 3 | module.exports = [ 4 | ...baseConfig, 5 | { 6 | files: ['**/*.ts'], 7 | languageOptions: { 8 | parserOptions: { 9 | projectService: true, 10 | tsconfigRootDir: __dirname, 11 | }, 12 | }, 13 | }, 14 | { 15 | files: ['**/*'], 16 | rules: {}, 17 | }, 18 | ]; 19 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-i18n/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rspack-csr-i18n", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": {}, 6 | "dependencies": { 7 | "@nx/angular-rspack": "workspace:*" 8 | }, 9 | "nx": { 10 | "i18n": { 11 | "sourceLocale": "en-GB", 12 | "locales": { 13 | "fr": { 14 | "translation": "e2e/fixtures/rspack-csr-i18n/src/locale/messages.fr.xlf" 15 | }, 16 | "es": { 17 | "translation": "e2e/fixtures/rspack-csr-i18n/src/locale/messages.es.xlf", 18 | "subPath": "es-ES" 19 | } 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-i18n/public/angular-rspack-logo-small.avif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-rspack/c7c5b1259eb2ff33e68561eb9025f5dca2fe790d/e2e/fixtures/rspack-csr-i18n/public/angular-rspack-logo-small.avif -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-i18n/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-rspack/c7c5b1259eb2ff33e68561eb9025f5dca2fe790d/e2e/fixtures/rspack-csr-i18n/public/favicon.ico -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-i18n/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-rspack/c7c5b1259eb2ff33e68561eb9025f5dca2fe790d/e2e/fixtures/rspack-csr-i18n/src/app/app.component.css -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-i18n/src/app/app.config.ts: -------------------------------------------------------------------------------- 1 | import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core'; 2 | import { provideRouter } from '@angular/router'; 3 | import { appRoutes } from './app.routes'; 4 | 5 | export const appConfig: ApplicationConfig = { 6 | providers: [ 7 | provideZoneChangeDetection({ eventCoalescing: true }), 8 | provideRouter(appRoutes), 9 | ], 10 | }; 11 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-i18n/src/app/app.routes.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | export const appRoutes: Route[] = []; 4 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-i18n/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | acme 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-i18n/src/main.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import '@angular/common/locales/global/fr'; 3 | import '@angular/common/locales/global/es'; 4 | import { bootstrapApplication } from '@angular/platform-browser'; 5 | import { appConfig } from './app/app.config'; 6 | import { AppComponent } from './app/app.component'; 7 | 8 | bootstrapApplication(AppComponent, appConfig).catch((err) => 9 | console.error(err) 10 | ); 11 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-i18n/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-i18n/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../../dist/out-tsc", 5 | "types": ["@angular/localize"] 6 | }, 7 | "files": ["src/main.ts"], 8 | "include": ["src/**/*.d.ts"], 9 | "exclude": [ 10 | "jest.config.ts", 11 | "src/**/*.test.ts", 12 | "src/**/*.spec.ts", 13 | "vite.config.ts", 14 | "vite.config.mts", 15 | "vitest.config.ts", 16 | "vitest.config.mts", 17 | "src/**/*.test.tsx", 18 | "src/**/*.spec.tsx", 19 | "src/**/*.test.js", 20 | "src/**/*.spec.js", 21 | "src/**/*.test.jsx", 22 | "src/**/*.spec.jsx" 23 | ], 24 | "references": [ 25 | { 26 | "path": "../../../packages/angular-rspack/tsconfig.lib.json" 27 | } 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-i18n/tsconfig.editor.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "include": ["src/**/*.ts"], 4 | "compilerOptions": {}, 5 | "exclude": [ 6 | "jest.config.ts", 7 | "src/**/*.test.ts", 8 | "src/**/*.spec.ts", 9 | "vite.config.ts", 10 | "vite.config.mts", 11 | "vitest.config.ts", 12 | "vitest.config.mts", 13 | "src/**/*.test.tsx", 14 | "src/**/*.spec.tsx", 15 | "src/**/*.test.js", 16 | "src/**/*.spec.js", 17 | "src/**/*.test.jsx", 18 | "src/**/*.spec.jsx" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-i18n/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2022", 4 | "esModuleInterop": true, 5 | "forceConsistentCasingInFileNames": true, 6 | "strict": true, 7 | "noImplicitOverride": true, 8 | "noPropertyAccessFromIndexSignature": true, 9 | "noImplicitReturns": true, 10 | "noFallthroughCasesInSwitch": true 11 | }, 12 | "files": [], 13 | "include": [], 14 | "references": [ 15 | { 16 | "path": "../../../packages/angular-rspack" 17 | }, 18 | { 19 | "path": "./tsconfig.editor.json" 20 | }, 21 | { 22 | "path": "./tsconfig.app.json" 23 | } 24 | ], 25 | "extends": "../../tsconfig.base.json", 26 | "angularCompilerOptions": { 27 | "enableI18nLegacyMessageIdFormat": false, 28 | "strictInjectionParameters": true, 29 | "strictInputAccessModifiers": true, 30 | "strictTemplates": true 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-scss/eslint.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('../../../eslint.config'); 2 | 3 | module.exports = [ 4 | ...baseConfig, 5 | { 6 | files: ['**/*.ts'], 7 | languageOptions: { 8 | parserOptions: { 9 | projectService: true, 10 | tsconfigRootDir: __dirname, 11 | }, 12 | }, 13 | }, 14 | { 15 | files: ['**/*'], 16 | rules: {}, 17 | }, 18 | ]; 19 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-scss/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rspack-csr-scss", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": {}, 6 | "dependencies": { 7 | "@nx/angular-rspack": "workspace:*" 8 | }, 9 | "nx": { 10 | "targets": { 11 | "build": { 12 | "inputs": [ 13 | { 14 | "env": "NGRS_CONFIG" 15 | } 16 | ] 17 | } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-scss/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-rspack/c7c5b1259eb2ff33e68561eb9025f5dca2fe790d/e2e/fixtures/rspack-csr-scss/public/favicon.ico -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-scss/src/app/app.component.html: -------------------------------------------------------------------------------- 1 |

Hello world!

2 |

component scss test

3 | 4 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-scss/src/app/app.component.scss: -------------------------------------------------------------------------------- 1 | $primary-color: #00f; 2 | p { 3 | color: $primary-color; 4 | } 5 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-scss/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { RouterModule } from '@angular/router'; 3 | 4 | @Component({ 5 | imports: [RouterModule], 6 | selector: 'app-root', 7 | templateUrl: './app.component.html', 8 | styleUrl: './app.component.scss', 9 | }) 10 | export class AppComponent { 11 | title = 'rspack-csr-scss'; 12 | } 13 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-scss/src/app/app.config.ts: -------------------------------------------------------------------------------- 1 | import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core'; 2 | import { provideRouter } from '@angular/router'; 3 | import { appRoutes } from './app.routes'; 4 | 5 | export const appConfig: ApplicationConfig = { 6 | providers: [ 7 | provideZoneChangeDetection({ eventCoalescing: true }), 8 | provideRouter(appRoutes), 9 | ], 10 | }; 11 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-scss/src/app/app.routes.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | export const appRoutes: Route[] = []; 4 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-scss/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | rspack-csr-scss 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-scss/src/main.ts: -------------------------------------------------------------------------------- 1 | import { bootstrapApplication } from '@angular/platform-browser'; 2 | import { appConfig } from './app/app.config'; 3 | import { AppComponent } from './app/app.component'; 4 | 5 | bootstrapApplication(AppComponent, appConfig).catch((err) => 6 | console.error(err) 7 | ); 8 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-scss/src/styles.scss: -------------------------------------------------------------------------------- 1 | @import 'base.scss'; 2 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-scss/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../../dist/out-tsc", 5 | "types": [] 6 | }, 7 | "files": ["src/main.ts"], 8 | "include": ["src/**/*.d.ts"], 9 | "references": [ 10 | { 11 | "path": "../../../packages/angular-rspack/tsconfig.lib.json" 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-scss/tsconfig.editor.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "include": ["src/**/*.ts"], 4 | "compilerOptions": {} 5 | } 6 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-scss/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2022", 4 | "esModuleInterop": true, 5 | "forceConsistentCasingInFileNames": true, 6 | "strict": true, 7 | "noImplicitOverride": true, 8 | "noPropertyAccessFromIndexSignature": true, 9 | "noImplicitReturns": true, 10 | "noFallthroughCasesInSwitch": true 11 | }, 12 | "files": [], 13 | "include": [], 14 | "references": [ 15 | { 16 | "path": "../../../packages/angular-rspack" 17 | }, 18 | { 19 | "path": "./tsconfig.editor.json" 20 | }, 21 | { 22 | "path": "./tsconfig.app.json" 23 | } 24 | ], 25 | "extends": "../../tsconfig.base.json", 26 | "angularCompilerOptions": { 27 | "enableI18nLegacyMessageIdFormat": false, 28 | "strictInjectionParameters": true, 29 | "strictInputAccessModifiers": true, 30 | "strictTemplates": true 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-tailwind/.postcssrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": { 3 | "@tailwindcss/postcss": {} 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-tailwind/eslint.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('../../../eslint.config'); 2 | 3 | module.exports = [ 4 | ...baseConfig, 5 | { 6 | files: ['**/*.ts'], 7 | languageOptions: { 8 | parserOptions: { 9 | projectService: true, 10 | tsconfigRootDir: __dirname, 11 | }, 12 | }, 13 | }, 14 | { 15 | files: ['**/*'], 16 | rules: {}, 17 | }, 18 | ]; 19 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-tailwind/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rspack-csr-tailwind", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": {}, 6 | "dependencies": { 7 | "@nx/angular-rspack": "workspace:*", 8 | "@tailwindcss/postcss": "^4.1.5" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-tailwind/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-rspack/c7c5b1259eb2ff33e68561eb9025f5dca2fe790d/e2e/fixtures/rspack-csr-tailwind/public/favicon.ico -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-tailwind/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-rspack/c7c5b1259eb2ff33e68561eb9025f5dca2fe790d/e2e/fixtures/rspack-csr-tailwind/src/app/app.component.css -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-tailwind/src/app/app.component.html: -------------------------------------------------------------------------------- 1 |

Hello world!

2 | 3 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-tailwind/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { RouterModule } from '@angular/router'; 3 | 4 | @Component({ 5 | imports: [RouterModule], 6 | selector: 'app-root', 7 | templateUrl: './app.component.html', 8 | styleUrl: './app.component.css', 9 | }) 10 | export class AppComponent { 11 | title = 'rspack-csr-tailwind'; 12 | } 13 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-tailwind/src/app/app.config.ts: -------------------------------------------------------------------------------- 1 | import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core'; 2 | import { provideRouter } from '@angular/router'; 3 | import { appRoutes } from './app.routes'; 4 | 5 | export const appConfig: ApplicationConfig = { 6 | providers: [ 7 | provideZoneChangeDetection({ eventCoalescing: true }), 8 | provideRouter(appRoutes), 9 | ], 10 | }; 11 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-tailwind/src/app/app.routes.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | export const appRoutes: Route[] = []; 4 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-tailwind/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | rspack-csr-tailwind 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-tailwind/src/main.ts: -------------------------------------------------------------------------------- 1 | import { bootstrapApplication } from '@angular/platform-browser'; 2 | import { appConfig } from './app/app.config'; 3 | import { AppComponent } from './app/app.component'; 4 | 5 | bootstrapApplication(AppComponent, appConfig).catch((err) => 6 | console.error(err) 7 | ); 8 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-tailwind/src/styles.css: -------------------------------------------------------------------------------- 1 | @import 'tailwindcss'; 2 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-tailwind/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../../dist/out-tsc", 5 | "types": [] 6 | }, 7 | "files": ["src/main.ts"], 8 | "include": ["src/**/*.d.ts"], 9 | "references": [ 10 | { 11 | "path": "../../../packages/angular-rspack/tsconfig.lib.json" 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-tailwind/tsconfig.editor.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "include": ["src/**/*.ts"], 4 | "compilerOptions": {} 5 | } 6 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-csr-tailwind/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2022", 4 | "esModuleInterop": true, 5 | "forceConsistentCasingInFileNames": true, 6 | "strict": true, 7 | "noImplicitOverride": true, 8 | "noPropertyAccessFromIndexSignature": true, 9 | "noImplicitReturns": true, 10 | "noFallthroughCasesInSwitch": true 11 | }, 12 | "files": [], 13 | "include": [], 14 | "references": [ 15 | { 16 | "path": "../../../packages/angular-rspack" 17 | }, 18 | { 19 | "path": "./tsconfig.editor.json" 20 | }, 21 | { 22 | "path": "./tsconfig.app.json" 23 | } 24 | ], 25 | "extends": "../../tsconfig.base.json", 26 | "angularCompilerOptions": { 27 | "enableI18nLegacyMessageIdFormat": false, 28 | "strictInjectionParameters": true, 29 | "strictInputAccessModifiers": true, 30 | "strictTemplates": true 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssg-css/eslint.next.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('../../../eslint.config'); 2 | 3 | module.exports = [ 4 | ...baseConfig, 5 | { 6 | files: ['**/*.ts'], 7 | languageOptions: { 8 | parserOptions: { 9 | projectService: true, 10 | tsconfigRootDir: __dirname, 11 | }, 12 | }, 13 | }, 14 | { 15 | files: ['**/*'], 16 | rules: {}, 17 | }, 18 | ]; 19 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssg-css/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rspack-ssg-css", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": {}, 6 | "dependencies": { 7 | "@nx/angular-rspack": "workspace:*" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssg-css/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-rspack/c7c5b1259eb2ff33e68561eb9025f5dca2fe790d/e2e/fixtures/rspack-ssg-css/public/favicon.ico -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssg-css/rspack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = () => { 2 | if (global.NX_GRAPH_CREATION === undefined) { 3 | const { createConfig } = require('@nx/angular-rspack'); 4 | return createConfig( 5 | { 6 | options: { 7 | root: __dirname, 8 | browser: './src/main.ts', 9 | index: './src/index.html', 10 | server: './src/main.server.ts', 11 | polyfills: ['zone.js'], 12 | ssr: { entry: './src/server.ts' }, 13 | prerender: true, 14 | assets: [ 15 | { 16 | glob: '**/*', 17 | input: './public', 18 | }, 19 | ], 20 | }, 21 | }, 22 | { 23 | development: { 24 | options: { 25 | optimization: false, 26 | }, 27 | }, 28 | } 29 | ); 30 | } 31 | return {}; 32 | }; 33 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssg-css/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-rspack/c7c5b1259eb2ff33e68561eb9025f5dca2fe790d/e2e/fixtures/rspack-ssg-css/src/app/app.component.css -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssg-css/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | @defer (hydrate on viewport) { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssg-css/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { RouterModule } from '@angular/router'; 3 | import { NxWelcomeComponent } from './nx-welcome.component'; 4 | import { FooComponent } from './foo.component'; 5 | 6 | @Component({ 7 | imports: [NxWelcomeComponent, RouterModule, FooComponent], 8 | selector: 'app-root', 9 | templateUrl: './app.component.html', 10 | styleUrl: './app.component.css', 11 | }) 12 | export class AppComponent { 13 | title = 'rspack-ssg-css'; 14 | } 15 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssg-css/src/app/app.config.server.ts: -------------------------------------------------------------------------------- 1 | import { mergeApplicationConfig, ApplicationConfig } from '@angular/core'; 2 | import { provideServerRendering } from '@angular/ssr'; 3 | import { appConfig } from './app.config'; 4 | 5 | const serverConfig: ApplicationConfig = { 6 | providers: [provideServerRendering()], 7 | }; 8 | 9 | export const config = mergeApplicationConfig(appConfig, serverConfig); 10 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssg-css/src/app/app.config.ts: -------------------------------------------------------------------------------- 1 | import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core'; 2 | import { provideRouter } from '@angular/router'; 3 | import { appRoutes } from './app.routes'; 4 | import { 5 | provideClientHydration, 6 | withEventReplay, 7 | withIncrementalHydration, 8 | } from '@angular/platform-browser'; 9 | 10 | export const appConfig: ApplicationConfig = { 11 | providers: [ 12 | provideClientHydration(withEventReplay(), withIncrementalHydration()), 13 | provideZoneChangeDetection({ eventCoalescing: true }), 14 | provideRouter(appRoutes), 15 | ], 16 | }; 17 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssg-css/src/app/app.routes.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | export const appRoutes: Route[] = [ 4 | { 5 | path: 'bar', 6 | loadComponent: () => 7 | import('./bar/bar.component').then((m) => m.BarComponent), 8 | }, 9 | { 10 | path: 'nested', 11 | loadChildren: () => 12 | import('./nested/nested.routes').then((m) => m.nestedRoutes), 13 | }, 14 | ]; 15 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssg-css/src/app/bar/bar.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-bar', 5 | template: `

Bar

`, 6 | styles: [], 7 | }) 8 | export class BarComponent {} 9 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssg-css/src/app/foo.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-foo', 5 | template: '
Foo
', 6 | }) 7 | export class FooComponent {} 8 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssg-css/src/app/nested/child-a/child-a.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-child-a', 5 | template: `

Child A

`, 6 | styles: [], 7 | }) 8 | export class ChildAComponent {} 9 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssg-css/src/app/nested/child-b/child-b.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-child-a', 5 | template: `

Child B

`, 6 | styles: [], 7 | }) 8 | export class ChildBComponent {} 9 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssg-css/src/app/nested/nested.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { RouterLink, RouterOutlet } from '@angular/router'; 3 | 4 | @Component({ 5 | imports: [RouterOutlet, RouterLink], 6 | selector: 'app-nested', 7 | template: `

Nested

8 | 9 | 13 | 14 | `, 15 | styles: [], 16 | }) 17 | export class NestedComponent {} 18 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssg-css/src/app/nested/nested.routes.ts: -------------------------------------------------------------------------------- 1 | import { NestedComponent } from './nested.component'; 2 | 3 | export const nestedRoutes = [ 4 | { 5 | path: '', 6 | component: NestedComponent, 7 | children: [ 8 | { 9 | path: 'child-a', 10 | loadComponent: () => 11 | import('./child-a/child-a.component').then((m) => m.ChildAComponent), 12 | }, 13 | { 14 | path: 'child-b', 15 | loadComponent: () => 16 | import('./child-b/child-b.component').then((m) => m.ChildBComponent), 17 | }, 18 | ], 19 | }, 20 | ]; 21 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssg-css/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | rspack-ssr-css 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssg-css/src/main.server.ts: -------------------------------------------------------------------------------- 1 | import { bootstrapApplication } from '@angular/platform-browser'; 2 | import { AppComponent } from './app/app.component'; 3 | import { config } from './app/app.config.server'; 4 | 5 | const bootstrap = () => bootstrapApplication(AppComponent, config); 6 | 7 | export default bootstrap; 8 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssg-css/src/main.ts: -------------------------------------------------------------------------------- 1 | import { bootstrapApplication } from '@angular/platform-browser'; 2 | import { appConfig } from './app/app.config'; 3 | import { AppComponent } from './app/app.component'; 4 | 5 | bootstrapApplication(AppComponent, appConfig).catch((err) => 6 | console.error(err) 7 | ); 8 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssg-css/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssg-css/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../dist/out-tsc", 5 | "types": ["node"] 6 | }, 7 | "files": ["src/main.ts", "src/main.server.ts", "src/server.ts"], 8 | "include": ["src/**/*.d.ts"], 9 | "exclude": [ 10 | "jest.config.ts", 11 | "src/**/*.test.ts", 12 | "src/**/*.spec.ts", 13 | "vite.config.ts", 14 | "vite.config.mts", 15 | "vitest.config.ts", 16 | "vitest.config.mts", 17 | "src/**/*.test.tsx", 18 | "src/**/*.spec.tsx", 19 | "src/**/*.test.js", 20 | "src/**/*.spec.js", 21 | "src/**/*.test.jsx", 22 | "src/**/*.spec.jsx" 23 | ], 24 | "references": [ 25 | { 26 | "path": "../../../packages/angular-rspack/tsconfig.lib.json" 27 | } 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssg-css/tsconfig.editor.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "include": ["src/**/*.ts"], 4 | "compilerOptions": {}, 5 | "exclude": [ 6 | "jest.config.ts", 7 | "src/**/*.test.ts", 8 | "src/**/*.spec.ts", 9 | "vite.config.ts", 10 | "vite.config.mts", 11 | "vitest.config.ts", 12 | "vitest.config.mts", 13 | "src/**/*.test.tsx", 14 | "src/**/*.spec.tsx", 15 | "src/**/*.test.js", 16 | "src/**/*.spec.js", 17 | "src/**/*.test.jsx", 18 | "src/**/*.spec.jsx" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssg-css/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2022", 4 | "esModuleInterop": true, 5 | "forceConsistentCasingInFileNames": true, 6 | "strict": true, 7 | "noImplicitOverride": true, 8 | "noPropertyAccessFromIndexSignature": true, 9 | "noImplicitReturns": true, 10 | "noFallthroughCasesInSwitch": true, 11 | "moduleResolution": "bundler" 12 | }, 13 | "files": [], 14 | "include": [], 15 | "references": [ 16 | { 17 | "path": "../../../packages/angular-rspack" 18 | }, 19 | { 20 | "path": "./tsconfig.editor.json" 21 | }, 22 | { 23 | "path": "./tsconfig.app.json" 24 | } 25 | ], 26 | "extends": "../../tsconfig.base.json", 27 | "angularCompilerOptions": { 28 | "enableI18nLegacyMessageIdFormat": false, 29 | "strictInjectionParameters": true, 30 | "strictInputAccessModifiers": true, 31 | "strictTemplates": true 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssr-css/eslint.next.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('../../../eslint.config'); 2 | 3 | module.exports = [ 4 | ...baseConfig, 5 | { 6 | files: ['**/*.ts'], 7 | languageOptions: { 8 | parserOptions: { 9 | projectService: true, 10 | tsconfigRootDir: __dirname, 11 | }, 12 | }, 13 | }, 14 | { 15 | files: ['**/*'], 16 | rules: {}, 17 | }, 18 | ]; 19 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssr-css/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rspack-ssr-css", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": {}, 6 | "dependencies": { 7 | "@nx/angular-rspack": "workspace:*" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssr-css/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-rspack/c7c5b1259eb2ff33e68561eb9025f5dca2fe790d/e2e/fixtures/rspack-ssr-css/public/favicon.ico -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssr-css/rspack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = () => { 2 | if (global.NX_GRAPH_CREATION === undefined) { 3 | const { createConfig } = require('@nx/angular-rspack'); 4 | return createConfig( 5 | { 6 | options: { 7 | root: __dirname, 8 | browser: './src/main.ts', 9 | index: './src/index.html', 10 | server: './src/main.server.ts', 11 | polyfills: ['zone.js'], 12 | ssr: { entry: './src/server.ts' }, 13 | verbose: true, 14 | assets: [ 15 | { 16 | glob: '**/*', 17 | input: './public', 18 | }, 19 | ], 20 | }, 21 | }, 22 | { 23 | development: { 24 | options: { 25 | optimization: false, 26 | }, 27 | }, 28 | } 29 | ); 30 | } 31 | return {}; 32 | }; 33 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssr-css/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-rspack/c7c5b1259eb2ff33e68561eb9025f5dca2fe790d/e2e/fixtures/rspack-ssr-css/src/app/app.component.css -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssr-css/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | @defer (hydrate on viewport) { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssr-css/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { RouterModule } from '@angular/router'; 3 | import { NxWelcomeComponent } from './nx-welcome.component'; 4 | import { FooComponent } from './foo.component'; 5 | 6 | @Component({ 7 | imports: [NxWelcomeComponent, RouterModule, FooComponent], 8 | selector: 'app-root', 9 | templateUrl: './app.component.html', 10 | styleUrl: './app.component.css', 11 | }) 12 | export class AppComponent { 13 | title = 'rspack-ssr-css'; 14 | } 15 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssr-css/src/app/app.config.server.ts: -------------------------------------------------------------------------------- 1 | import { mergeApplicationConfig, ApplicationConfig } from '@angular/core'; 2 | import { provideServerRendering } from '@angular/ssr'; 3 | import { appConfig } from './app.config'; 4 | 5 | const serverConfig: ApplicationConfig = { 6 | providers: [provideServerRendering()], 7 | }; 8 | 9 | export const config = mergeApplicationConfig(appConfig, serverConfig); 10 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssr-css/src/app/app.config.ts: -------------------------------------------------------------------------------- 1 | import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core'; 2 | import { provideRouter } from '@angular/router'; 3 | import { appRoutes } from './app.routes'; 4 | import { 5 | provideClientHydration, 6 | withEventReplay, 7 | withIncrementalHydration, 8 | } from '@angular/platform-browser'; 9 | 10 | export const appConfig: ApplicationConfig = { 11 | providers: [ 12 | provideClientHydration(withEventReplay(), withIncrementalHydration()), 13 | provideZoneChangeDetection({ eventCoalescing: true }), 14 | provideRouter(appRoutes), 15 | ], 16 | }; 17 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssr-css/src/app/app.routes.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | export const appRoutes: Route[] = []; 4 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssr-css/src/app/foo.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-foo', 5 | template: '
Foo
', 6 | }) 7 | export class FooComponent {} 8 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssr-css/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | rspack-ssr-css 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssr-css/src/main.server.ts: -------------------------------------------------------------------------------- 1 | import { bootstrapApplication } from '@angular/platform-browser'; 2 | import { AppComponent } from './app/app.component'; 3 | import { config } from './app/app.config.server'; 4 | 5 | const bootstrap = () => bootstrapApplication(AppComponent, config); 6 | 7 | export default bootstrap; 8 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssr-css/src/main.ts: -------------------------------------------------------------------------------- 1 | import { bootstrapApplication } from '@angular/platform-browser'; 2 | import { appConfig } from './app/app.config'; 3 | import { AppComponent } from './app/app.component'; 4 | 5 | bootstrapApplication(AppComponent, appConfig).catch((err) => 6 | console.error(err) 7 | ); 8 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssr-css/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssr-css/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../dist/out-tsc", 5 | "types": ["node"] 6 | }, 7 | "files": ["src/main.ts", "src/main.server.ts", "src/server.ts"], 8 | "include": ["src/**/*.d.ts"], 9 | "exclude": [ 10 | "jest.config.ts", 11 | "src/**/*.test.ts", 12 | "src/**/*.spec.ts", 13 | "vite.config.ts", 14 | "vite.config.mts", 15 | "vitest.config.ts", 16 | "vitest.config.mts", 17 | "src/**/*.test.tsx", 18 | "src/**/*.spec.tsx", 19 | "src/**/*.test.js", 20 | "src/**/*.spec.js", 21 | "src/**/*.test.jsx", 22 | "src/**/*.spec.jsx" 23 | ], 24 | "references": [ 25 | { 26 | "path": "../../../packages/angular-rspack/tsconfig.lib.json" 27 | } 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssr-css/tsconfig.editor.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "include": ["src/**/*.ts"], 4 | "compilerOptions": {}, 5 | "exclude": [ 6 | "jest.config.ts", 7 | "src/**/*.test.ts", 8 | "src/**/*.spec.ts", 9 | "vite.config.ts", 10 | "vite.config.mts", 11 | "vitest.config.ts", 12 | "vitest.config.mts", 13 | "src/**/*.test.tsx", 14 | "src/**/*.spec.tsx", 15 | "src/**/*.test.js", 16 | "src/**/*.spec.js", 17 | "src/**/*.test.jsx", 18 | "src/**/*.spec.jsx" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /e2e/fixtures/rspack-ssr-css/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2022", 4 | "esModuleInterop": true, 5 | "forceConsistentCasingInFileNames": true, 6 | "strict": true, 7 | "noImplicitOverride": true, 8 | "noPropertyAccessFromIndexSignature": true, 9 | "noImplicitReturns": true, 10 | "noFallthroughCasesInSwitch": true, 11 | "moduleResolution": "bundler" 12 | }, 13 | "files": [], 14 | "include": [], 15 | "references": [ 16 | { 17 | "path": "../../../packages/angular-rspack" 18 | }, 19 | { 20 | "path": "./tsconfig.editor.json" 21 | }, 22 | { 23 | "path": "./tsconfig.app.json" 24 | } 25 | ], 26 | "extends": "../../tsconfig.base.json", 27 | "angularCompilerOptions": { 28 | "enableI18nLegacyMessageIdFormat": false, 29 | "strictInjectionParameters": true, 30 | "strictInputAccessModifiers": true, 31 | "strictTemplates": true 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /e2e/fixtures/shared/assets/src/assets/icons/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-rspack/c7c5b1259eb2ff33e68561eb9025f5dca2fe790d/e2e/fixtures/shared/assets/src/assets/icons/github.png -------------------------------------------------------------------------------- /e2e/fixtures/shared/scripts/shared-script.js: -------------------------------------------------------------------------------- 1 | console.log('shared-script'); 2 | -------------------------------------------------------------------------------- /e2e/fixtures/shared/styles/src/base.scss: -------------------------------------------------------------------------------- 1 | h1 { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /e2e/fixtures/shared/styles/src/index.scss: -------------------------------------------------------------------------------- 1 | @import './lib/global'; 2 | -------------------------------------------------------------------------------- /e2e/fixtures/shared/styles/src/lib/global.scss: -------------------------------------------------------------------------------- 1 | .icon-github { 2 | background-image: url('/assets/icons/github.png'); 3 | } 4 | -------------------------------------------------------------------------------- /e2e/rsbuild-csr-css-e2e/eslint.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('../../eslint.config'); 2 | 3 | module.exports = [ 4 | ...baseConfig, 5 | { 6 | files: ['**/*.ts'], 7 | languageOptions: { 8 | parserOptions: { 9 | projectService: true, 10 | tsconfigRootDir: __dirname, 11 | }, 12 | }, 13 | }, 14 | { 15 | files: ['**/*.json'], 16 | rules: { 17 | '@nx/dependency-checks': [ 18 | 'error', 19 | { 20 | ignoredFiles: [ 21 | '{projectRoot}/eslint.config.{js,cjs,mjs}', 22 | '{projectRoot}/vite.config.{js,ts,mjs,mts}', 23 | '{projectRoot}/vitest.config.{js,ts,mjs,mts}', 24 | ], 25 | }, 26 | ], 27 | }, 28 | languageOptions: { 29 | parser: require('jsonc-eslint-parser'), 30 | }, 31 | }, 32 | ]; 33 | -------------------------------------------------------------------------------- /e2e/rsbuild-csr-css-e2e/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rsbuild-csr-css-e2e", 3 | "$schema": "../../node_modules/nx/schemas/project-schema.json", 4 | "projectType": "application", 5 | "sourceRoot": "e2e/rsbuild-csr-css-e2e/src", 6 | "implicitDependencies": ["rsbuild-csr-css"], 7 | "// targets": "to see all targets run: nx show project rsbuild-csr-css-e2e --web", 8 | "targets": {} 9 | } 10 | -------------------------------------------------------------------------------- /e2e/rsbuild-csr-css-e2e/src/example.spec.ts: -------------------------------------------------------------------------------- 1 | import { test, expect } from '@playwright/test'; 2 | 3 | test('has title', async ({ page }) => { 4 | await page.goto('/'); 5 | 6 | // Expect h1 to contain a substring. 7 | expect(await page.locator('h1').innerText()).toContain('Welcome'); 8 | }); 9 | -------------------------------------------------------------------------------- /e2e/rsbuild-csr-css-e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "allowJs": true, 5 | "outDir": "../../dist/out-tsc", 6 | "sourceMap": false, 7 | "module": "commonjs", 8 | "forceConsistentCasingInFileNames": true, 9 | "strict": true, 10 | "noImplicitOverride": true, 11 | "noPropertyAccessFromIndexSignature": true, 12 | "noImplicitReturns": true, 13 | "noFallthroughCasesInSwitch": true 14 | }, 15 | "include": [ 16 | "**/*.ts", 17 | "**/*.js", 18 | "playwright.config.ts", 19 | "src/**/*.spec.ts", 20 | "src/**/*.spec.js", 21 | "src/**/*.test.ts", 22 | "src/**/*.test.js", 23 | "src/**/*.d.ts" 24 | ], 25 | "references": [ 26 | { 27 | "path": "./tsconfig.test.json" 28 | } 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /e2e/rsbuild-csr-css-e2e/tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "allowJs": true, 5 | "outDir": "../../dist/out-tsc", 6 | "sourceMap": false, 7 | "module": "commonjs", 8 | "forceConsistentCasingInFileNames": true, 9 | "strict": true, 10 | "noImplicitOverride": true, 11 | "noPropertyAccessFromIndexSignature": true, 12 | "noImplicitReturns": true, 13 | "noFallthroughCasesInSwitch": true 14 | }, 15 | "exclude": [ 16 | "**/*.ts", 17 | "**/*.js", 18 | "playwright.config.ts", 19 | "src/**/*.spec.ts", 20 | "src/**/*.spec.js", 21 | "src/**/*.test.ts", 22 | "src/**/*.test.js", 23 | "src/**/*.d.ts" 24 | ], 25 | "include": ["./mocks/**/*.ts"], 26 | "references": [ 27 | { 28 | "path": "../../testing/utils" 29 | } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /e2e/rsbuild-csr-less-e2e/eslint.config.js: -------------------------------------------------------------------------------- 1 | const nextEslintConfig = require('./eslint.next.config'); 2 | 3 | // 🚨 DO NOT EDIT THIS FILE MANUALLY! 🚨 4 | // Run `pnpm eslint-next/nx` to update or remove this file if all rules pass. 5 | // Add new rules globally to the `eslint.config.js` or locally to the `eslint.next.config.js` file. 6 | // For details, refer to: tools/scripts/eslint-next/README.md 7 | module.exports = [...nextEslintConfig]; 8 | -------------------------------------------------------------------------------- /e2e/rsbuild-csr-less-e2e/eslint.next.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('../../eslint.config'); 2 | 3 | module.exports = [ 4 | ...baseConfig, 5 | { 6 | files: ['**/*.ts'], 7 | languageOptions: { 8 | parserOptions: { 9 | projectService: true, 10 | tsconfigRootDir: __dirname, 11 | }, 12 | }, 13 | }, 14 | { 15 | files: ['**/*.json'], 16 | rules: { 17 | '@nx/dependency-checks': [ 18 | 'error', 19 | { 20 | ignoredFiles: [ 21 | '{projectRoot}/eslint.config.{js,cjs,mjs}', 22 | '{projectRoot}/vite.config.{js,ts,mjs,mts}', 23 | '{projectRoot}/vitest.config.{js,ts,mjs,mts}', 24 | ], 25 | }, 26 | ], 27 | }, 28 | languageOptions: { 29 | parser: require('jsonc-eslint-parser'), 30 | }, 31 | }, 32 | ]; 33 | -------------------------------------------------------------------------------- /e2e/rsbuild-csr-less-e2e/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rsbuild-csr-less-e2e", 3 | "$schema": "../../node_modules/nx/schemas/project-schema.json", 4 | "projectType": "application", 5 | "sourceRoot": "e2e/rsbuild-csr-less-e2e/src", 6 | "implicitDependencies": ["rsbuild-csr-less"], 7 | "// targets": "to see all targets run: nx show project rsbuild-csr-less-e2e --web", 8 | "targets": {} 9 | } 10 | -------------------------------------------------------------------------------- /e2e/rsbuild-csr-less-e2e/src/example.spec.ts: -------------------------------------------------------------------------------- 1 | import { test, expect } from '@playwright/test'; 2 | 3 | test('has title', async ({ page }) => { 4 | await page.goto('/'); 5 | 6 | // Expect h1 to contain a substring. 7 | expect(await page.locator('h1').innerText()).toContain('Welcome'); 8 | }); 9 | -------------------------------------------------------------------------------- /e2e/rsbuild-csr-less-e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "allowJs": true, 5 | "outDir": "../../dist/out-tsc", 6 | "sourceMap": false, 7 | "module": "commonjs", 8 | "forceConsistentCasingInFileNames": true, 9 | "strict": true, 10 | "noImplicitOverride": true, 11 | "noPropertyAccessFromIndexSignature": true, 12 | "noImplicitReturns": true, 13 | "noFallthroughCasesInSwitch": true 14 | }, 15 | "include": [ 16 | "**/*.ts", 17 | "**/*.js", 18 | "playwright.config.ts", 19 | "src/**/*.spec.ts", 20 | "src/**/*.spec.js", 21 | "src/**/*.test.ts", 22 | "src/**/*.test.js", 23 | "src/**/*.d.ts" 24 | ], 25 | "references": [ 26 | { 27 | "path": "./tsconfig.test.json" 28 | } 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /e2e/rsbuild-csr-less-e2e/tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "allowJs": true, 5 | "outDir": "../../dist/out-tsc", 6 | "sourceMap": false, 7 | "module": "commonjs", 8 | "forceConsistentCasingInFileNames": true, 9 | "strict": true, 10 | "noImplicitOverride": true, 11 | "noPropertyAccessFromIndexSignature": true, 12 | "noImplicitReturns": true, 13 | "noFallthroughCasesInSwitch": true 14 | }, 15 | "exclude": [ 16 | "**/*.ts", 17 | "**/*.js", 18 | "playwright.config.ts", 19 | "src/**/*.spec.ts", 20 | "src/**/*.spec.js", 21 | "src/**/*.test.ts", 22 | "src/**/*.test.js", 23 | "src/**/*.d.ts" 24 | ], 25 | "include": ["./mocks/**/*.ts"], 26 | "references": [ 27 | { 28 | "path": "../../testing/utils" 29 | } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /e2e/rsbuild-csr-scss-e2e/eslint.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('../../eslint.config'); 2 | 3 | module.exports = [ 4 | ...baseConfig, 5 | { 6 | files: ['**/*.ts'], 7 | languageOptions: { 8 | parserOptions: { 9 | projectService: true, 10 | tsconfigRootDir: __dirname, 11 | }, 12 | }, 13 | }, 14 | { 15 | files: ['**/*'], 16 | rules: {}, 17 | }, 18 | ]; 19 | -------------------------------------------------------------------------------- /e2e/rsbuild-csr-scss-e2e/eslint.next.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('../../eslint.config'); 2 | 3 | module.exports = [ 4 | ...baseConfig, 5 | { 6 | files: ['**/*.ts'], 7 | languageOptions: { 8 | parserOptions: { 9 | projectService: true, 10 | tsconfigRootDir: __dirname, 11 | }, 12 | }, 13 | }, 14 | { 15 | files: ['**/*'], 16 | rules: {}, 17 | }, 18 | ]; 19 | -------------------------------------------------------------------------------- /e2e/rsbuild-csr-scss-e2e/eslint.next.config.js~merged: -------------------------------------------------------------------------------- 1 | <<<<<<< HEAD 2 | const baseConfig = require('../../eslint.config'); 3 | ======= 4 | <<<<<<< HEAD:e2e/fixtures/rsbuild-csr-scss/eslint.next.config.js 5 | const baseConfig = require('../../../eslint.config'); 6 | ======= 7 | const baseConfig = require('../../eslint.config'); 8 | >>>>>>> main:e2e/rsbuild-csr-scss-e2e/eslint.next.config.js 9 | >>>>>>> main 10 | 11 | module.exports = [ 12 | ...baseConfig, 13 | { 14 | files: ['**/*.ts'], 15 | languageOptions: { 16 | parserOptions: { 17 | projectService: true, 18 | tsconfigRootDir: __dirname, 19 | }, 20 | }, 21 | }, 22 | { 23 | files: ['**/*'], 24 | rules: {}, 25 | }, 26 | ]; 27 | -------------------------------------------------------------------------------- /e2e/rsbuild-csr-scss-e2e/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rsbuild-csr-scss-e2e", 3 | "$schema": "../../node_modules/nx/schemas/project-schema.json", 4 | "projectType": "application", 5 | "sourceRoot": "e2e/rsbuild-csr-scss-e2e/src", 6 | "implicitDependencies": ["rsbuild-csr-scss"], 7 | "// targets": "to see all targets run: nx show project rsbuild-csr-scss-e2e --web", 8 | "targets": {} 9 | } 10 | -------------------------------------------------------------------------------- /e2e/rsbuild-csr-scss-e2e/src/example.spec.ts: -------------------------------------------------------------------------------- 1 | import { test, expect } from '@playwright/test'; 2 | 3 | test('has title', async ({ page }) => { 4 | await page.goto('/'); 5 | 6 | // Expect h1 to contain a substring. 7 | expect(await page.locator('h1').innerText()).toContain('Welcome'); 8 | }); 9 | -------------------------------------------------------------------------------- /e2e/rsbuild-csr-scss-e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "allowJs": true, 5 | "outDir": "../../../dist/out-tsc", 6 | "sourceMap": false, 7 | "module": "commonjs", 8 | "forceConsistentCasingInFileNames": true, 9 | "strict": true, 10 | "noImplicitOverride": true, 11 | "noPropertyAccessFromIndexSignature": true, 12 | "noImplicitReturns": true, 13 | "noFallthroughCasesInSwitch": true 14 | }, 15 | "include": [ 16 | "**/*.ts", 17 | "**/*.js", 18 | "playwright.config.ts", 19 | "src/**/*.spec.ts", 20 | "src/**/*.spec.js", 21 | "src/**/*.test.ts", 22 | "src/**/*.test.js", 23 | "src/**/*.d.ts" 24 | ], 25 | "references": [] 26 | } 27 | -------------------------------------------------------------------------------- /e2e/rsbuild-ssr-css-e2e/eslint.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('../../eslint.config'); 2 | 3 | module.exports = [ 4 | ...baseConfig, 5 | { 6 | files: ['**/*.ts'], 7 | languageOptions: { 8 | parserOptions: { 9 | projectService: true, 10 | tsconfigRootDir: __dirname, 11 | }, 12 | }, 13 | }, 14 | { 15 | files: ['**/*.ts'], 16 | languageOptions: { 17 | parserOptions: { 18 | projectService: true, 19 | tsconfigRootDir: __dirname, 20 | }, 21 | }, 22 | }, 23 | { 24 | files: ['**/*'], 25 | rules: {}, 26 | }, 27 | ]; 28 | -------------------------------------------------------------------------------- /e2e/rsbuild-ssr-css-e2e/eslint.next.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('../../eslint.config'); 2 | 3 | module.exports = [ 4 | ...baseConfig, 5 | { 6 | files: ['**/*.ts'], 7 | languageOptions: { 8 | parserOptions: { 9 | projectService: true, 10 | tsconfigRootDir: __dirname, 11 | }, 12 | }, 13 | }, 14 | { 15 | files: ['**/*'], 16 | rules: {}, 17 | }, 18 | ]; 19 | -------------------------------------------------------------------------------- /e2e/rsbuild-ssr-css-e2e/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rsbuild-ssr-css-e2e", 3 | "$schema": "../../node_modules/nx/schemas/project-schema.json", 4 | "projectType": "application", 5 | "sourceRoot": "e2e/rsbuild-ssr-css-e2e/src", 6 | "implicitDependencies": ["rsbuild-ssr-css"], 7 | "// targets": "to see all targets run: nx show project rsbuild-ssr-css-e2e --web", 8 | "targets": {} 9 | } 10 | -------------------------------------------------------------------------------- /e2e/rsbuild-ssr-css-e2e/src/example.spec.ts: -------------------------------------------------------------------------------- 1 | import { test, expect } from '@playwright/test'; 2 | 3 | test('has title', async ({ page }) => { 4 | await page.goto('/'); 5 | 6 | // Expect h1 to contain a substring. 7 | expect(await page.locator('h1').innerText()).toContain('Welcome'); 8 | }); 9 | -------------------------------------------------------------------------------- /e2e/rsbuild-ssr-css-e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "allowJs": true, 5 | "outDir": "../dist/out-tsc", 6 | "sourceMap": false, 7 | "module": "commonjs", 8 | "forceConsistentCasingInFileNames": true, 9 | "strict": true, 10 | "noImplicitOverride": true, 11 | "noPropertyAccessFromIndexSignature": true, 12 | "noImplicitReturns": true, 13 | "noFallthroughCasesInSwitch": true 14 | }, 15 | "include": [ 16 | "**/*.ts", 17 | "**/*.js", 18 | "playwright.config.ts", 19 | "src/**/*.spec.ts", 20 | "src/**/*.spec.js", 21 | "src/**/*.test.ts", 22 | "src/**/*.test.js", 23 | "src/**/*.d.ts" 24 | ], 25 | "references": [] 26 | } 27 | -------------------------------------------------------------------------------- /e2e/tsconfig.base.json: -------------------------------------------------------------------------------- 1 | { 2 | "//There are some settings in the TS Project References that angular can't run on.": "", 3 | "//Therefore we do not extend the root": "", 4 | "compileOnSave": false, 5 | "compilerOptions": { 6 | "rootDir": ".", 7 | "sourceMap": true, 8 | "declaration": false, 9 | "moduleResolution": "node", 10 | "emitDecoratorMetadata": true, 11 | "experimentalDecorators": true, 12 | "importHelpers": true, 13 | "target": "es2015", 14 | "module": "esnext", 15 | "lib": ["es2020", "dom"], 16 | "skipLibCheck": true, 17 | "skipDefaultLibCheck": true, 18 | "baseUrl": ".", 19 | "paths": {} 20 | }, 21 | "exclude": ["node_modules", "tmp"] 22 | } 23 | -------------------------------------------------------------------------------- /eslint/README.md: -------------------------------------------------------------------------------- 1 | ## ⚙️ Configs 2 | 3 | | Stack | Config | Description | 4 | | :---------: | :------------------------------- | :------------------------------------------------ | 5 | | ![vitest]() | [vitest](./src/config/vitest.js) | Config for projects using **Vitest** for testing. | 6 | -------------------------------------------------------------------------------- /eslint/eslint.config.js: -------------------------------------------------------------------------------- 1 | const nextEslintConfig = require('./eslint.next.config'); 2 | 3 | module.exports = [...nextEslintConfig]; 4 | -------------------------------------------------------------------------------- /eslint/eslint.next.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('../eslint.config.js'); 2 | 3 | module.exports = [ 4 | ...baseConfig, 5 | { 6 | files: ['**/*.json'], 7 | rules: { 8 | '@nx/dependency-checks': [ 9 | 'error', 10 | { 11 | ignoredFiles: [ 12 | '{projectRoot}/eslint.config.{js,cjs,mjs}', 13 | '{projectRoot}/vite.config.{js,ts,mjs,mts}', 14 | ], 15 | }, 16 | ], 17 | }, 18 | languageOptions: { 19 | parser: require('jsonc-eslint-parser'), 20 | }, 21 | }, 22 | ]; 23 | -------------------------------------------------------------------------------- /eslint/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@ng-rspack/eslint", 3 | "private": false, 4 | "nx": { 5 | "sourceRoot": "eslint/eslint/src", 6 | "projectType": "library", 7 | "name": "eslint-config", 8 | "targets": { 9 | "integration-test": { 10 | "options": { 11 | "config": "vitest.integration.config.mts" 12 | } 13 | } 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /eslint/src/lib/config/javascript.js: -------------------------------------------------------------------------------- 1 | module.exports = [ 2 | { 3 | files: ['**/*.{js,ts}'], 4 | rules: { 5 | '@typescript-eslint/no-unused-vars': [ 6 | 'error', 7 | { 8 | argsIgnorePattern: '^_', 9 | destructuredArrayIgnorePattern: '^_', 10 | ignoreRestSiblings: true, 11 | }, 12 | ], 13 | }, 14 | }, 15 | ]; 16 | -------------------------------------------------------------------------------- /eslint/src/lib/utils/utils.js: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | 3 | /** 4 | * Changes all errors to warnings in rule config. 5 | * 6 | * @param {Partial | undefined} rules - Rules config (e.g., recommended). 7 | * @returns {Partial} 8 | */ 9 | function convertErrorsToWarnings(rules) { 10 | return Object.fromEntries( 11 | Object.entries(rules ?? {}).map(([ruleId, entry]) => [ 12 | ruleId, 13 | entry === 'error' || entry === 2 ? 'warn' : entry, 14 | ]) 15 | ); 16 | } 17 | 18 | module.exports = { convertErrorsToWarnings }; 19 | -------------------------------------------------------------------------------- /packages/angular-rsbuild/.npmignore: -------------------------------------------------------------------------------- 1 | !dist 2 | dist/tsconfig.lib.tsbuildinfo 3 | code-pushup.config.ts 4 | eslint.next.config.js 5 | eslint.config.js 6 | project.json 7 | tsconfig.json 8 | tsconfig.lib.json 9 | tsconfig.spec.json 10 | vite.config.ts 11 | src/**/*.ts 12 | mocks 13 | vitest.config.mts 14 | vitest.integration.config.mts 15 | -------------------------------------------------------------------------------- /packages/angular-rsbuild/code-pushup.config.ts: -------------------------------------------------------------------------------- 1 | import { CoreConfig } from '@code-pushup/models'; 2 | import { mergeConfigs } from '@code-pushup/utils'; 3 | import { 4 | baseConfig, 5 | coverageCoreConfig, 6 | eslintConfig, 7 | } from '../../tools/reports/code-pushup.preset.config'; 8 | 9 | export default mergeConfigs( 10 | baseConfig as CoreConfig, 11 | await eslintConfig(), 12 | await coverageCoreConfig() 13 | ); 14 | -------------------------------------------------------------------------------- /packages/angular-rsbuild/eslint.config.js: -------------------------------------------------------------------------------- 1 | const nextEslintConfig = require('./eslint.next.config'); 2 | 3 | // 🚨 DO NOT EDIT THIS FILE MANUALLY! 🚨 4 | // Run `pnpm eslint-next/nx` to update or remove this file if all rules pass. 5 | // Add new rules globally to the `eslint.config.js` or locally to the `eslint.next.config.js` file. 6 | // For details, refer to: tools/scripts/eslint-next/README.md 7 | module.exports = [ 8 | ...nextEslintConfig, 9 | { 10 | files: ['**/*'], 11 | rules: { 12 | // ❌ Errors: 1 13 | '@typescript-eslint/no-unused-vars': 'off', // ❌ 3 errors 14 | // ⚠️ Warnings: 3 15 | 'vitest/prefer-to-be': 'off', // ⚠️ 2 warnings 🛠️ 16 | '@typescript-eslint/no-non-null-assertion': 'off', // ⚠️ 2 warnings 17 | '@typescript-eslint/no-explicit-any': 'off', // ⚠️ 1 warning 18 | }, 19 | }, 20 | ]; 21 | -------------------------------------------------------------------------------- /packages/angular-rsbuild/mocks/fixtures/integration/minimal/other/mock.main.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-rspack/c7c5b1259eb2ff33e68561eb9025f5dca2fe790d/packages/angular-rsbuild/mocks/fixtures/integration/minimal/other/mock.main.ts -------------------------------------------------------------------------------- /packages/angular-rsbuild/mocks/fixtures/integration/minimal/rsbuild.mock.config.ts: -------------------------------------------------------------------------------- 1 | import { createConfig } from '../../../../src'; 2 | 3 | export default createConfig({ 4 | browser: './src/main.ts', 5 | inlineStylesExtension: 'css', 6 | tsconfigPath: './mocks/fixtures/integration/minimal/tsconfig.mock.json', 7 | }); 8 | -------------------------------------------------------------------------------- /packages/angular-rsbuild/mocks/fixtures/integration/minimal/src/mock.main.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-rspack/c7c5b1259eb2ff33e68561eb9025f5dca2fe790d/packages/angular-rsbuild/mocks/fixtures/integration/minimal/src/mock.main.ts -------------------------------------------------------------------------------- /packages/angular-rsbuild/src/index.ts: -------------------------------------------------------------------------------- 1 | import { pluginAngular } from './lib/plugin/plugin-angular'; 2 | import { PluginAngularOptions } from './lib/models/plugin-options'; 3 | import { createConfig } from './lib/config/create-config'; 4 | 5 | export { pluginAngular, createConfig }; 6 | export type { PluginAngularOptions }; 7 | export default pluginAngular; 8 | -------------------------------------------------------------------------------- /packages/angular-rsbuild/src/lib/config/load-esm.ts: -------------------------------------------------------------------------------- 1 | let load: ((modulePath: string | URL) => Promise) | undefined; 2 | 3 | export function loadEsmModule(modulePath: string | URL): Promise { 4 | load ??= new Function('modulePath', `return import(modulePath);`) as Exclude< 5 | typeof load, 6 | undefined 7 | >; 8 | 9 | return load(modulePath); 10 | } 11 | -------------------------------------------------------------------------------- /packages/angular-rsbuild/src/lib/models/normalize-options.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginAngularOptions } from '../models'; 2 | export declare function normalizeOptions( 3 | options: Partial 4 | ): PluginAngularOptions; 5 | -------------------------------------------------------------------------------- /packages/angular-rsbuild/src/lib/models/plugin-options.d.ts: -------------------------------------------------------------------------------- 1 | export interface PluginAngularOptions { 2 | root: string; 3 | jit: boolean; 4 | inlineStylesExtension: 'css' | 'scss' | 'sass' | 'less'; 5 | tsconfigPath: string; 6 | } 7 | -------------------------------------------------------------------------------- /packages/angular-rsbuild/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "files": [], 4 | "include": [], 5 | "references": [ 6 | { 7 | "path": "../../testing/utils" 8 | }, 9 | { 10 | "path": "../angular-rspack-compiler" 11 | }, 12 | { 13 | "path": "../../testing/setup" 14 | }, 15 | { 16 | "path": "./tsconfig.lib.json" 17 | }, 18 | { 19 | "path": "./tsconfig.spec.json" 20 | } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/angular-rsbuild/vitest.config.mts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | import { resolve } from 'path'; 3 | import { EXCLUDED_FILES_TEST } from '@ng-rspack/testing-setup'; 4 | 5 | export default defineConfig({ 6 | cacheDir: '../../node_modules/.vite/angular-rsbuild/unit', 7 | root: __dirname, 8 | plugins: [], 9 | resolve: { 10 | alias: { 11 | '@ng-rspack/testing-utils': resolve(__dirname, '../../testing/utils/src'), 12 | }, 13 | }, 14 | test: { 15 | watch: false, 16 | globals: true, 17 | environment: 'node', 18 | include: ['src/**/*.unit.test.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], 19 | setupFiles: ['../../testing/vitest-setup/src/lib/fs-memfs.setup-file.ts'], 20 | reporters: ['default'], 21 | coverage: { 22 | provider: 'v8', 23 | reporter: ['text', 'lcov'], 24 | reportsDirectory: '../../coverage/angular-rsbuild/unit', 25 | exclude: [...EXCLUDED_FILES_TEST], 26 | }, 27 | }, 28 | }); 29 | -------------------------------------------------------------------------------- /packages/angular-rspack-compiler/.npmignore: -------------------------------------------------------------------------------- 1 | !dist 2 | dist/tsconfig.lib.tsbuildinfo 3 | code-pushup.config.ts 4 | eslint.next.config.js 5 | eslint.config.*js 6 | project.json 7 | tsconfig.json 8 | tsconfig.lib.json 9 | tsconfig.spec.json 10 | vitest*.config.*ts 11 | src/**/*.ts 12 | mocks 13 | **/*.tgz 14 | vitest.config.mts 15 | vitest.integration.config.mts 16 | -------------------------------------------------------------------------------- /packages/angular-rspack-compiler/README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | Rsbuild Plugin Angular 4 | 5 |
6 | 7 | # @nx/angular-rspack-compiler 8 | 9 | ## Compilation Utilities for Angular with Rspack and Rsbuild 10 | 11 | This library provides utilities for compiling Angular applications with Rspack and Rsbuild. 12 | -------------------------------------------------------------------------------- /packages/angular-rspack-compiler/code-pushup.config.ts: -------------------------------------------------------------------------------- 1 | import { CoreConfig } from '@code-pushup/models'; 2 | import { mergeConfigs } from '@code-pushup/utils'; 3 | import { 4 | baseConfig, 5 | coverageCoreConfig, 6 | eslintConfig, 7 | } from '../../tools/reports/code-pushup.preset.config'; 8 | 9 | export default mergeConfigs( 10 | baseConfig as CoreConfig, 11 | await eslintConfig(), 12 | await coverageCoreConfig() 13 | ); 14 | -------------------------------------------------------------------------------- /packages/angular-rspack-compiler/eslint.config.js: -------------------------------------------------------------------------------- 1 | const nextEslintConfig = require('./eslint.next.config'); 2 | 3 | // 🚨 DO NOT EDIT THIS FILE MANUALLY! 🚨 4 | // Run `pnpm eslint-next/nx` to update or remove this file if all rules pass. 5 | // Add new rules globally to the `eslint.config.js` or locally to the `eslint.next.config.js` file. 6 | // For details, refer to: tools/scripts/eslint-next/README.md 7 | module.exports = [ 8 | ...nextEslintConfig, 9 | { 10 | files: ['**/*'], 11 | rules: { 12 | // ❌ Errors: 1 13 | 'vitest/valid-describe-callback': 'off', // ❌ 2 errors 14 | }, 15 | }, 16 | ]; 17 | -------------------------------------------------------------------------------- /packages/angular-rspack-compiler/eslint.next.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('../../eslint.config.js'); 2 | 3 | module.exports = [ 4 | ...baseConfig, 5 | { 6 | files: ['**/*.json'], 7 | rules: { 8 | '@nx/dependency-checks': [ 9 | 'error', 10 | { 11 | ignoredFiles: [ 12 | '{projectRoot}/eslint.config.{js,cjs,mjs}', 13 | '{projectRoot}/vite.config.{js,ts,mjs,mts}', 14 | ], 15 | ignoredDependencies: [ 16 | '@angular/core', 17 | '@code-pushup/models', 18 | '@code-pushup/utils', 19 | 'jsonc-eslint-parser', 20 | 'vitest', 21 | ], 22 | }, 23 | ], 24 | }, 25 | languageOptions: { 26 | parser: require('jsonc-eslint-parser'), 27 | }, 28 | }, 29 | ]; 30 | -------------------------------------------------------------------------------- /packages/angular-rspack-compiler/mocks/fixtures/integration/minimal/other/mock.main.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-rspack/c7c5b1259eb2ff33e68561eb9025f5dca2fe790d/packages/angular-rspack-compiler/mocks/fixtures/integration/minimal/other/mock.main.ts -------------------------------------------------------------------------------- /packages/angular-rspack-compiler/mocks/fixtures/integration/minimal/rsbuild.mock.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from '@rsbuild/core'; 2 | 3 | export default defineConfig({ 4 | root: './', 5 | source: { 6 | tsconfigPath: './mocks/fixtures/integration/minimal/tsconfig.mock.json', 7 | }, 8 | environments: { 9 | browser: { 10 | source: { 11 | entry: { 12 | index: './src/main.ts', 13 | }, 14 | }, 15 | output: { 16 | target: 'web', 17 | distPath: { 18 | root: 'dist/browser', 19 | }, 20 | }, 21 | html: { 22 | template: 'index.html', 23 | }, 24 | }, 25 | }, 26 | }); 27 | -------------------------------------------------------------------------------- /packages/angular-rspack-compiler/mocks/fixtures/integration/minimal/src/mock.main.ts: -------------------------------------------------------------------------------- 1 | export const random = 42; 2 | -------------------------------------------------------------------------------- /packages/angular-rspack-compiler/mocks/fixtures/integration/minimal/src/styles.css: -------------------------------------------------------------------------------- 1 | .btn { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /packages/angular-rspack-compiler/src/compilation/build-and-analyze.ts: -------------------------------------------------------------------------------- 1 | import { JavaScriptTransformer } from '@angular/build/src/tools/esbuild/javascript-transformer'; 2 | import { normalize } from 'path'; 3 | import { AngularCompilation } from '../models'; 4 | 5 | export async function buildAndAnalyze( 6 | angularCompilation: AngularCompilation, 7 | typescriptFileCache: Map, 8 | javascriptTransformer: JavaScriptTransformer 9 | ) { 10 | for (const { 11 | filename, 12 | contents, 13 | } of await angularCompilation.emitAffectedFiles()) { 14 | const normalizedFilename = normalize(filename.replace(/^[A-Z]:/, '')); 15 | await javascriptTransformer 16 | .transformData(normalizedFilename, contents, true, false) 17 | .then((contents) => { 18 | typescriptFileCache.set( 19 | normalizedFilename, 20 | Buffer.from(contents).toString() 21 | ); 22 | }); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /packages/angular-rspack-compiler/src/compilation/index.ts: -------------------------------------------------------------------------------- 1 | export * from './augments'; 2 | export * from './build-and-analyze'; 3 | export * from './setup-compilation'; 4 | export * from './setup-with-angular-compilation'; 5 | -------------------------------------------------------------------------------- /packages/angular-rspack-compiler/src/compilation/setup-compilation.d.ts: -------------------------------------------------------------------------------- 1 | import { RsbuildConfig } from '@rsbuild/core'; 2 | import * as compilerCli from '@angular/compiler-cli'; 3 | import * as ts from 'typescript'; 4 | import { PluginAngularOptions } from '../models'; 5 | export declare function setupCompilation( 6 | config: RsbuildConfig, 7 | options: PluginAngularOptions 8 | ): { 9 | rootNames: string[]; 10 | compilerOptions: compilerCli.CompilerOptions; 11 | host: ts.CompilerHost; 12 | }; 13 | -------------------------------------------------------------------------------- /packages/angular-rspack-compiler/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './compilation'; 2 | export * from './models'; 3 | export * from './utils'; 4 | -------------------------------------------------------------------------------- /packages/angular-rspack-compiler/src/models/compiler-plugin-options.ts: -------------------------------------------------------------------------------- 1 | import { SourceFileCache } from '../utils/source-file-cache'; 2 | 3 | export interface CompilerPluginOptions { 4 | sourcemap: boolean; 5 | tsconfig: string; 6 | aot?: boolean; 7 | /** Skip TypeScript compilation setup. This is useful to re-use the TypeScript compilation from another plugin. */ 8 | noopTypeScriptCompilation?: boolean; 9 | advancedOptimizations?: boolean; 10 | thirdPartySourcemaps?: boolean; 11 | fileReplacements?: Record; 12 | sourceFileCache?: SourceFileCache; 13 | incremental: boolean; 14 | useTsProjectReferences?: boolean; 15 | } 16 | -------------------------------------------------------------------------------- /packages/angular-rspack-compiler/src/models/file-replacement.ts: -------------------------------------------------------------------------------- 1 | export interface FileReplacement { 2 | replace: string; 3 | with: string; 4 | } 5 | -------------------------------------------------------------------------------- /packages/angular-rspack-compiler/src/models/index.d.ts: -------------------------------------------------------------------------------- 1 | export * from './file-emitter'; 2 | export * from './plugin-options'; 3 | -------------------------------------------------------------------------------- /packages/angular-rspack-compiler/src/models/inline-style-language.ts: -------------------------------------------------------------------------------- 1 | export type InlineStyleLanguage = 'css' | 'scss' | 'sass' | 'less'; 2 | -------------------------------------------------------------------------------- /packages/angular-rspack-compiler/src/utils/constants.ts: -------------------------------------------------------------------------------- 1 | export const ENV_NG_BUILD_MAX_WORKERS = 'NG_BUILD_MAX_WORKERS'; 2 | -------------------------------------------------------------------------------- /packages/angular-rspack-compiler/src/utils/index.ts: -------------------------------------------------------------------------------- 1 | export * from './regex-filters'; 2 | export * from './component-resolvers'; 3 | export * from './load-compiler-cli'; 4 | export { maxWorkers } from './utils'; 5 | -------------------------------------------------------------------------------- /packages/angular-rspack-compiler/src/utils/load-compiler-cli.ts: -------------------------------------------------------------------------------- 1 | let load; 2 | export function loadCompilerCli(): Promise< 3 | typeof import('@angular/compiler-cli') 4 | > { 5 | load ??= new Function('', `return import('@angular/compiler-cli');`); 6 | return load().catch((e) => { 7 | throw new Error( 8 | `Failed to load Angular Compiler CLI: ${e.message ?? e.toString()}` 9 | ); 10 | }); 11 | } 12 | -------------------------------------------------------------------------------- /packages/angular-rspack-compiler/src/utils/regex-filters.d.ts: -------------------------------------------------------------------------------- 1 | export declare const TS_EXT_REGEX: RegExp; 2 | export declare const JS_EXT_REGEX: RegExp; 3 | -------------------------------------------------------------------------------- /packages/angular-rspack-compiler/src/utils/regex-filters.ts: -------------------------------------------------------------------------------- 1 | export const TS_ALL_EXT_REGEX = /\.[cm]?(ts)[^x]?\??/; 2 | export const JS_ALL_EXT_REGEX = /\.[cm]?(js)[^x]?\??/; 3 | export const JS_EXT_REGEX = /\.[cm]?js$/; 4 | 5 | export function isStandardJsFile(filename: string) { 6 | return JS_EXT_REGEX.test(filename); 7 | } 8 | -------------------------------------------------------------------------------- /packages/angular-rspack-compiler/src/utils/source-file-cache.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright Google LLC All Rights Reserved. 4 | * 5 | * Use of this source code is governed by an MIT-style license that can be 6 | * found in the LICENSE file at https://angular.io/license 7 | */ 8 | import type ts from 'typescript'; 9 | export declare class SourceFileCache extends Map { 10 | readonly persistentCachePath?: string | undefined; 11 | readonly modifiedFiles: Set; 12 | readonly babelFileCache: Map; 13 | readonly typeScriptFileCache: Map; 14 | referencedFiles?: readonly string[]; 15 | constructor(persistentCachePath?: string | undefined); 16 | invalidate(files: Iterable): void; 17 | } 18 | -------------------------------------------------------------------------------- /packages/angular-rspack-compiler/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "files": [], 4 | "include": [], 5 | "references": [ 6 | { 7 | "path": "../../testing/setup" 8 | }, 9 | { 10 | "path": "../../testing/utils" 11 | }, 12 | { 13 | "path": "./tsconfig.lib.json" 14 | }, 15 | { 16 | "path": "./tsconfig.spec.json" 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /packages/angular-rspack-compiler/vitest.integration.config.mts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | import { resolve } from 'path'; 3 | import { EXCLUDED_FILES_TEST } from '@ng-rspack/testing-setup'; 4 | 5 | export default defineConfig({ 6 | root: __dirname, 7 | cacheDir: '../../node_modules/.vite/angular-rspack-compiler/integration', 8 | plugins: [], 9 | resolve: { 10 | alias: { 11 | '@ng-rspack/testing-utils': resolve(__dirname, '../../testing/utils/src'), 12 | }, 13 | }, 14 | test: { 15 | watch: false, 16 | globals: true, 17 | environment: 'node', 18 | include: ['src/**/*.integration.test.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], 19 | passWithNoTests: true, 20 | reporters: ['default'], 21 | coverage: { 22 | provider: 'v8', 23 | reporter: ['text', 'lcov'], 24 | reportsDirectory: '../../coverage/angular-rspack-compiler/integration', 25 | exclude: [...EXCLUDED_FILES_TEST], 26 | }, 27 | }, 28 | }); 29 | -------------------------------------------------------------------------------- /packages/angular-rspack/.npmignore: -------------------------------------------------------------------------------- 1 | !dist 2 | dist/tsconfig.lib.tsbuildinfo 3 | code-pushup.config.ts 4 | eslint.next.config.js 5 | eslint.config.js 6 | project.json 7 | tsconfig.json 8 | tsconfig.lib.json 9 | tsconfig.spec.json 10 | vite.config.ts 11 | src/**/*.ts 12 | !src/lib/patch 13 | .swcrc 14 | vitest.config.mts 15 | vitest.integration.config.mts 16 | -------------------------------------------------------------------------------- /packages/angular-rspack/code-pushup.config.ts: -------------------------------------------------------------------------------- 1 | import { CoreConfig } from '@code-pushup/models'; 2 | import { mergeConfigs } from '@code-pushup/utils'; 3 | import { 4 | baseConfig, 5 | coverageCoreConfig, 6 | eslintConfig, 7 | } from '../../tools/reports/code-pushup.preset.config'; 8 | 9 | export default mergeConfigs( 10 | baseConfig as CoreConfig, 11 | await eslintConfig(), 12 | await coverageCoreConfig() 13 | ); 14 | -------------------------------------------------------------------------------- /packages/angular-rspack/eslint.config.js: -------------------------------------------------------------------------------- 1 | const nextEslintConfig = require('./eslint.next.config'); 2 | 3 | // 🚨 DO NOT EDIT THIS FILE MANUALLY! 🚨 4 | // Run `pnpm eslint-next/nx` to update or remove this file if all rules pass. 5 | // Add new rules globally to the `eslint.config.js` or locally to the `eslint.next.config.js` file. 6 | // For details, refer to: tools/scripts/eslint-next/README.md 7 | module.exports = [ 8 | ...nextEslintConfig, 9 | { 10 | files: ['**/*'], 11 | rules: { 12 | // ⚠️ Warnings: 1 13 | '@typescript-eslint/no-explicit-any': 'off', // ⚠️ 1 warning 14 | }, 15 | }, 16 | ]; 17 | -------------------------------------------------------------------------------- /packages/angular-rspack/src/lib/index.d.ts: -------------------------------------------------------------------------------- 1 | export * as rspack from './rspack'; 2 | export * as rsbuild from './rsbuild'; 3 | -------------------------------------------------------------------------------- /packages/angular-rspack/src/lib/index.ts: -------------------------------------------------------------------------------- 1 | export * from './config/create-config'; 2 | export * from './plugins/ng-rspack'; 3 | export { configureSourceMap } from './config/config-utils/sourcemap-utils'; 4 | export { getCrossOriginLoading } from './config/config-utils/helpers'; 5 | export { getOptimization } from './config/config-utils/optimization-config'; 6 | export { VENDORS_TEST } from './config/config-utils/optimization-config'; 7 | -------------------------------------------------------------------------------- /packages/angular-rspack/src/lib/models/augmented-compilation.ts: -------------------------------------------------------------------------------- 1 | import type { Compilation } from '@rspack/core'; 2 | import type { 3 | JavaScriptTransformer, 4 | SourceFileCache, 5 | } from '@nx/angular-rspack-compiler'; 6 | import { I18nOptions } from './i18n'; 7 | 8 | export const NG_RSPACK_SYMBOL_NAME = 'NG_RSPACK_BUILD'; 9 | 10 | export type NG_RSPACK_COMPILATION_STATE = { 11 | javascriptTransformer: JavaScriptTransformer; 12 | typescriptFileCache: SourceFileCache['typeScriptFileCache']; 13 | i18n?: I18nOptions; 14 | }; 15 | export type NgRspackCompilation = Compilation & { 16 | [NG_RSPACK_SYMBOL_NAME]: () => NG_RSPACK_COMPILATION_STATE; 17 | }; 18 | -------------------------------------------------------------------------------- /packages/angular-rspack/src/lib/models/index.ts: -------------------------------------------------------------------------------- 1 | export * from './angular-rspack-plugin-options'; 2 | export * from './augmented-compilation'; 3 | export * from './i18n'; 4 | export * from './normalize-options'; 5 | -------------------------------------------------------------------------------- /packages/angular-rspack/src/lib/plugins/client/ssr-reload-client.ts: -------------------------------------------------------------------------------- 1 | // @ts-expect-error: This is a client-side file 2 | const socket = new WebSocket(`ws://localhost:60000`); 3 | 4 | socket.addEventListener('message', (event) => { 5 | if (event.data === 'ssr-reload') { 6 | console.log('[AngularSSRDevServer] Reloading the page...'); 7 | // @ts-expect-error: This is a client-side file 8 | window.location.reload(); 9 | } 10 | }); 11 | 12 | socket.addEventListener('open', () => { 13 | console.log('[AngularSSRDevServer] WebSocket connection established.'); 14 | }); 15 | 16 | socket.addEventListener('close', () => { 17 | console.warn('[AngularSSRDevServer] WebSocket connection closed.'); 18 | }); 19 | -------------------------------------------------------------------------------- /packages/angular-rspack/src/lib/plugins/loaders/hmr-accept-loader.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright Google LLC All Rights Reserved. 4 | * 5 | * Use of this source code is governed by an MIT-style license that can be 6 | * found in the LICENSE file at https://angular.dev/license 7 | */ 8 | 9 | import { join } from 'node:path'; 10 | import { LoaderContext, LoaderDefinitionFunction } from '@rspack/core'; 11 | 12 | export const HmrLoader = __filename; 13 | const hmrAcceptPath = join(__dirname, './hmr-accept.js').replace(/\\/g, '/'); 14 | 15 | export default function localizeExtractLoader( 16 | this: LoaderContext, 17 | content: string, 18 | map: Parameters[1] 19 | ) { 20 | const source = `${content} 21 | 22 | // HMR Accept Code 23 | import ngHmrAccept from '${hmrAcceptPath}'; 24 | ngHmrAccept(module); 25 | `; 26 | 27 | this.callback(null, source, map); 28 | 29 | return; 30 | } 31 | -------------------------------------------------------------------------------- /packages/angular-rspack/src/lib/plugins/loaders/platform-server-exports.loader.ts: -------------------------------------------------------------------------------- 1 | import { 2 | type LoaderContext, 3 | type LoaderDefinitionFunction, 4 | } from '@rspack/core'; 5 | 6 | export default function loader( 7 | this: LoaderContext<{ angularSSRInstalled: boolean }>, 8 | content: string, 9 | map: Parameters[1] 10 | ) { 11 | const { angularSSRInstalled } = this.getOptions(); 12 | 13 | let source = `${content} 14 | 15 | // EXPORTS added by @nx/angular-rspack 16 | export { renderApplication, renderModule, ɵSERVER_CONTEXT } from '@angular/platform-server'; 17 | `; 18 | 19 | if (angularSSRInstalled) { 20 | source += ` 21 | export { ɵgetRoutesFromAngularRouterConfig } from '@angular/ssr'; 22 | `; 23 | } 24 | 25 | this.callback(null, source, map); 26 | 27 | return; 28 | } 29 | -------------------------------------------------------------------------------- /packages/angular-rspack/src/lib/plugins/rxjs-esm-resolution.ts: -------------------------------------------------------------------------------- 1 | import { Compiler, RspackPluginInstance } from '@rspack/core'; 2 | 3 | export class RxjsEsmResolutionPlugin implements RspackPluginInstance { 4 | apply(compiler: Compiler) { 5 | compiler.hooks.normalModuleFactory.tap( 6 | 'RxJSEsmResolution', 7 | (normalModuleFactory) => { 8 | normalModuleFactory.hooks.resolve.tap('RxJSEsmResolution', (data) => { 9 | if (data.request.startsWith('rxjs')) { 10 | data.request = data.request.replace( 11 | /([\\/]dist[\\/])cjs([\\/])/, 12 | '$1esm$2' 13 | ); 14 | } 15 | }); 16 | } 17 | ); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /packages/angular-rspack/src/lib/plugins/server/ssr-reload-server.ts: -------------------------------------------------------------------------------- 1 | import { WebSocket, Server } from 'ws'; 2 | 3 | export class SsrReloadServer { 4 | #server: Server; 5 | 6 | constructor() { 7 | this.#server = new WebSocket.Server({ port: 60_000 }); 8 | process.on('SIGTERM', () => this.#server.close()); 9 | process.on('exit', () => this.#server.close()); 10 | } 11 | 12 | sendReload() { 13 | this.#server.clients.forEach((client) => { 14 | client.send('ssr-reload'); 15 | }); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/angular-rspack/src/lib/plugins/tools/worker-pool.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright Google LLC All Rights Reserved. 4 | * 5 | * Use of this source code is governed by an MIT-style license that can be 6 | * found in the LICENSE file at https://angular.dev/license 7 | */ 8 | 9 | import { Piscina } from 'piscina'; 10 | 11 | export type WorkerPoolOptions = ConstructorParameters[0]; 12 | 13 | export class WorkerPool extends Piscina { 14 | constructor(options: WorkerPoolOptions) { 15 | const piscinaOptions: WorkerPoolOptions = { 16 | minThreads: 1, 17 | idleTimeout: 1000, 18 | recordTiming: false, 19 | ...options, 20 | }; 21 | 22 | super(piscinaOptions); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /packages/angular-rspack/src/lib/utils/get-locale-base-href.ts: -------------------------------------------------------------------------------- 1 | import { I18nOptions } from '../models'; 2 | import { urlJoin } from './url-join'; 3 | 4 | export function getLocaleBaseHref( 5 | i18n: I18nOptions, 6 | locale: string, 7 | baseHref?: string 8 | ): string | undefined { 9 | if (i18n.flatOutput) { 10 | return undefined; 11 | } 12 | 13 | const localeData = i18n.locales[locale]; 14 | if (!localeData) { 15 | return undefined; 16 | } 17 | 18 | const baseHrefSuffix = localeData.baseHref ?? localeData.subPath + '/'; 19 | 20 | return baseHrefSuffix !== '' 21 | ? urlJoin(baseHref || '', baseHrefSuffix) 22 | : undefined; 23 | } 24 | -------------------------------------------------------------------------------- /packages/angular-rspack/src/lib/utils/graph.ts: -------------------------------------------------------------------------------- 1 | import { 2 | createProjectGraphAsync, 3 | readCachedProjectGraph, 4 | type ProjectGraph, 5 | } from '@nx/devkit'; 6 | 7 | export async function retrieveOrCreateProjectGraph(): Promise { 8 | let projectGraph: ProjectGraph | null = null; 9 | try { 10 | projectGraph = readCachedProjectGraph(); 11 | } catch { 12 | // ignore 13 | } 14 | 15 | try { 16 | if (!projectGraph) { 17 | projectGraph = await createProjectGraphAsync({ 18 | exitOnError: false, 19 | resetDaemonClient: true, 20 | }); 21 | } 22 | } catch { 23 | // ignore 24 | } 25 | 26 | return projectGraph; 27 | } 28 | -------------------------------------------------------------------------------- /packages/angular-rspack/src/lib/utils/i18n.ts: -------------------------------------------------------------------------------- 1 | import { existsSync, mkdirSync } from 'node:fs'; 2 | import { join } from 'node:path'; 3 | import type { I18nOptions } from '../models'; 4 | 5 | export function ensureOutputPaths( 6 | baseOutputPath: string, 7 | i18n: I18nOptions 8 | ): Map { 9 | const outputPaths = getLocaleOutputPaths(i18n); 10 | 11 | for (const [, outputPath] of outputPaths) { 12 | const fullPath = join(baseOutputPath, outputPath); 13 | if (!existsSync(fullPath)) { 14 | mkdirSync(fullPath, { recursive: true }); 15 | } 16 | } 17 | 18 | return outputPaths; 19 | } 20 | 21 | export function getLocaleOutputPaths(i18n: I18nOptions): Map { 22 | const outputPaths: [string, string][] = i18n.shouldInline 23 | ? [...i18n.inlineLocales].map((l) => [ 24 | l, 25 | i18n.flatOutput ? '' : i18n.locales[l].subPath, 26 | ]) 27 | : [['', '']]; 28 | 29 | return new Map(outputPaths); 30 | } 31 | -------------------------------------------------------------------------------- /packages/angular-rspack/src/lib/utils/index-file/add-body-script.ts: -------------------------------------------------------------------------------- 1 | import { htmlRewritingStream } from './html-rewriting-stream'; 2 | 3 | export async function addBodyScript( 4 | html: string, 5 | bodyScriptContents: string 6 | ): Promise { 7 | const { rewriter, transformedContent } = await htmlRewritingStream(html); 8 | 9 | const bodyScript = ``; 10 | 11 | rewriter.on('startTag', (tag) => { 12 | rewriter.emitStartTag(tag); 13 | 14 | if (tag.tagName === 'body') { 15 | rewriter.emitRaw(bodyScript); 16 | } 17 | }); 18 | 19 | return transformedContent(); 20 | } 21 | -------------------------------------------------------------------------------- /packages/angular-rspack/src/lib/utils/index-file/get-index-input-file.ts: -------------------------------------------------------------------------------- 1 | import type { IndexExpandedDefinition } from '../../models'; 2 | 3 | export function getIndexInputFile(index: IndexExpandedDefinition): string { 4 | if (typeof index === 'string') { 5 | return index; 6 | } 7 | 8 | return index.input; 9 | } 10 | -------------------------------------------------------------------------------- /packages/angular-rspack/src/lib/utils/index-file/get-index-output-file.ts: -------------------------------------------------------------------------------- 1 | import type { IndexExpandedDefinition } from '../../models'; 2 | import { basename } from 'node:path'; 3 | 4 | export function getIndexOutputFile(index: IndexExpandedDefinition): string { 5 | if (typeof index === 'string') { 6 | return basename(index); 7 | } 8 | 9 | return index.output || 'index.html'; 10 | } 11 | -------------------------------------------------------------------------------- /packages/angular-rspack/src/lib/utils/max-workers.ts: -------------------------------------------------------------------------------- 1 | import { availableParallelism } from 'node:os'; 2 | 3 | const ENV_NG_BUILD_MAX_WORKERS = 'NG_BUILD_MAX_WORKERS'; 4 | 5 | function isPresent(variable: string | undefined): variable is string { 6 | return typeof variable === 'string' && variable.trim() !== ''; 7 | } 8 | 9 | function parseMaxWorkers(value: string | undefined): number | null { 10 | if (!isPresent(value)) return null; 11 | const parsed = Number(value); 12 | return Number.isNaN(parsed) || parsed <= 0 ? null : parsed; // Ensure valid positive number 13 | } 14 | 15 | export const maxWorkers = () => { 16 | const parsedWorkers = parseMaxWorkers(process.env[ENV_NG_BUILD_MAX_WORKERS]); 17 | return parsedWorkers !== null 18 | ? parsedWorkers 19 | : Math.min(4, Math.max(availableParallelism() - 1, 1)); 20 | }; 21 | -------------------------------------------------------------------------------- /packages/angular-rspack/src/lib/utils/tty.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright Google LLC All Rights Reserved. 4 | * 5 | * Use of this source code is governed by an MIT-style license that can be 6 | * found in the LICENSE file at https://angular.dev/license 7 | */ 8 | 9 | function _isTruthy(value: undefined | string): boolean { 10 | // Returns true if value is a string that is anything but 0 or false. 11 | return ( 12 | value !== undefined && value !== '0' && value.toUpperCase() !== 'FALSE' 13 | ); 14 | } 15 | 16 | export function isTTY(): boolean { 17 | // If we force TTY, we always return true. 18 | const force = process.env['NG_FORCE_TTY']; 19 | if (force !== undefined) { 20 | return _isTruthy(force); 21 | } 22 | 23 | return !!process.stdout.isTTY && !_isTruthy(process.env['CI']); 24 | } 25 | -------------------------------------------------------------------------------- /packages/angular-rspack/src/lib/utils/url-join.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright Google LLC All Rights Reserved. 4 | * 5 | * Use of this source code is governed by an MIT-style license that can be 6 | * found in the LICENSE file at https://angular.dev/license 7 | */ 8 | 9 | export function urlJoin(...parts: string[]): string { 10 | const [p, ...rest] = parts; 11 | 12 | // Remove trailing slash from first part 13 | // Join all parts with `/` 14 | // Dedupe double slashes from path names 15 | return p.replace(/\/$/, '') + ('/' + rest.join('/')).replace(/\/\/+/g, '/'); 16 | } 17 | -------------------------------------------------------------------------------- /packages/angular-rspack/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "files": [], 4 | "include": [], 5 | "references": [ 6 | { 7 | "path": "../angular-rspack-compiler" 8 | }, 9 | { 10 | "path": "../../testing/setup" 11 | }, 12 | { 13 | "path": "./tsconfig.lib.json" 14 | }, 15 | { 16 | "path": "./tsconfig.spec.json" 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /packages/angular-rspack/vitest.config.mts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | import { EXCLUDED_FILES_TEST } from '@ng-rspack/testing-setup'; 3 | 4 | export default defineConfig({ 5 | cacheDir: '../../node_modules/.vite/ng-rspack-build/unit', 6 | root: __dirname, 7 | test: { 8 | watch: false, 9 | globals: true, 10 | environment: 'node', 11 | include: ['src/**/*.unit.test.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], 12 | coverage: { 13 | provider: 'v8', 14 | reporter: ['text', 'lcov'], 15 | reportsDirectory: '../../coverage/build/unit', 16 | exclude: [...EXCLUDED_FILES_TEST], 17 | }, 18 | reporters: ['default'], 19 | passWithNoTests: true, 20 | }, 21 | }); 22 | -------------------------------------------------------------------------------- /packages/angular-rspack/vitest.integration.config.mts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | import { resolve } from 'path'; 3 | import { EXCLUDED_FILES_TEST } from '@ng-rspack/testing-setup'; 4 | 5 | export default defineConfig({ 6 | root: __dirname, 7 | cacheDir: '../../node_modules/.vite/build/integration', 8 | plugins: [], 9 | resolve: { 10 | alias: { 11 | '@ng-rspack/testing-utils': resolve(__dirname, '../../testing/utils/src'), 12 | }, 13 | }, 14 | test: { 15 | watch: false, 16 | globals: true, 17 | environment: 'node', 18 | include: ['src/**/*.integration.test.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], 19 | passWithNoTests: true, 20 | reporters: ['default'], 21 | coverage: { 22 | provider: 'v8', 23 | reporter: ['text', 'lcov'], 24 | reportsDirectory: '../../coverage/build/integration', 25 | exclude: [...EXCLUDED_FILES_TEST], 26 | }, 27 | }, 28 | }); 29 | -------------------------------------------------------------------------------- /pnpm-workspace.yaml: -------------------------------------------------------------------------------- 1 | packages: 2 | - apps/** 3 | - e2e/** 4 | - tmp/** 5 | - packages/* 6 | - testing/* 7 | -------------------------------------------------------------------------------- /project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@ng-rspack/source", 3 | "$schema": "node_modules/nx/schemas/project-schema.json", 4 | "targets": { 5 | "local-registry": { 6 | "executor": "@nx/js:verdaccio", 7 | "options": { 8 | "port": 4873, 9 | "config": ".verdaccio/config.yml", 10 | "storage": "tmp/local-registry/storage" 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /rsbuild-plugin-angular.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-rspack/c7c5b1259eb2ff33e68561eb9025f5dca2fe790d/rsbuild-plugin-angular.png -------------------------------------------------------------------------------- /testing/setup/README.md: -------------------------------------------------------------------------------- 1 | # testing-vitest-setup 2 | 3 | This library provides a set of setup scripts for testing. 4 | As this package is never directly referenced, but only it's files it does not maintain a `index.ts` entry point. 5 | 6 | ## The many content divides into: 7 | 8 | - **Setup files** - obey to the naming pattern `-setup-file.ts` and should be used in a `vite.config.ts` testing config under the `setupFiles` property. 9 | - **Global setup files** - obey to the naming pattern `-global-setup-file.ts` and should be used in a `vite.config.ts` testing config under the `globalSetup` property. 10 | -------------------------------------------------------------------------------- /testing/setup/eslint.config.js: -------------------------------------------------------------------------------- 1 | const nextEslintConfig = require('./eslint.next.config'); 2 | 3 | // 🚨 DO NOT EDIT THIS FILE MANUALLY! 🚨 4 | // Run `pnpm eslint-next/nx` to update or remove this file if all rules pass. 5 | // Add new rules globally to the `eslint.config.js` or locally to the `eslint.next.config.js` file. 6 | // For details, refer to: tools/scripts/eslint-next/README.md 7 | module.exports = [ 8 | ...nextEslintConfig, 9 | { 10 | files: ['**/*'], 11 | rules: {}, 12 | }, 13 | ]; 14 | -------------------------------------------------------------------------------- /testing/setup/eslint.next.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('../../eslint.config.js'); 2 | 3 | module.exports = [ 4 | ...baseConfig, 5 | { 6 | files: ['**/*.ts'], 7 | languageOptions: { 8 | parserOptions: { 9 | projectService: true, 10 | tsconfigRootDir: __dirname, 11 | }, 12 | }, 13 | }, 14 | { 15 | files: ['**/*.json'], 16 | rules: { 17 | '@nx/dependency-checks': [ 18 | 'error', 19 | { 20 | ignoredFiles: [ 21 | '{projectRoot}/eslint*.config.{js,cjs,mjs}', 22 | '{projectRoot}/vite.config.{js,ts,mjs,mts}', 23 | '{projectRoot}/vitest*.config.{js,ts,mjs,mts}', 24 | ], 25 | }, 26 | ], 27 | }, 28 | languageOptions: { 29 | parser: require('jsonc-eslint-parser'), 30 | }, 31 | }, 32 | ]; 33 | -------------------------------------------------------------------------------- /testing/setup/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@ng-rspack/testing-setup", 3 | "type": "commonjs", 4 | "version": "0.0.1", 5 | "dependencies": {}, 6 | "devDependencies": { 7 | "vitest": "^1.3.1", 8 | "vite-plugin-dts": "^4.5.0" 9 | }, 10 | "main": "./src/index.mjs", 11 | "types": "./src/index.d.ts", 12 | "private": true, 13 | "nx": { 14 | "sourceRoot": "testing/setup/src", 15 | "projectType": "library", 16 | "name": "testing-setup" 17 | }, 18 | "module": "./src/index.mjs" 19 | } 20 | -------------------------------------------------------------------------------- /testing/setup/src/index.d.ts: -------------------------------------------------------------------------------- 1 | export const EXCLUDED_FILES_TEST: string[]; 2 | -------------------------------------------------------------------------------- /testing/setup/src/index.mjs: -------------------------------------------------------------------------------- 1 | export const EXCLUDED_FILES_TEST = [ 2 | 'mocks/**', 3 | '**/types.ts', 4 | '**/*.d.ts', 5 | '__snapshots__/**', 6 | '**/__tests__/**', 7 | '**/code-pushup.config.ts', 8 | '**/eslint*.config.js', 9 | '**/vitest*.config.mts', 10 | ]; 11 | -------------------------------------------------------------------------------- /testing/setup/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "files": [], 4 | "include": [], 5 | "references": [ 6 | { 7 | "path": "./tsconfig.lib.json" 8 | }, 9 | { 10 | "path": "./tsconfig.spec.json" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /testing/setup/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "baseUrl": ".", 5 | "rootDir": "src", 6 | "outDir": "dist", 7 | "tsBuildInfoFile": "dist/tsconfig.lib.tsbuildinfo", 8 | "emitDeclarationOnly": false, 9 | "types": ["node", "vite/client"] 10 | }, 11 | "include": ["src/**/*.ts"], 12 | "exclude": [ 13 | "vite.config.ts", 14 | "vite.config.mts", 15 | "vitest.config.ts", 16 | "vitest.config.mts", 17 | "vitest.integration.config.mts", 18 | "src/**/*.test.ts", 19 | "src/**/*.spec.ts", 20 | "src/**/*.test.tsx", 21 | "src/**/*.spec.tsx", 22 | "src/**/*.test.js", 23 | "src/**/*.spec.js", 24 | "src/**/*.test.jsx", 25 | "src/**/*.spec.jsx" 26 | ], 27 | "references": [] 28 | } 29 | -------------------------------------------------------------------------------- /testing/setup/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "types": ["vitest/globals", "vitest/importMeta", "vite/client", "node"] 6 | }, 7 | "include": [ 8 | "vite.config.ts", 9 | "vitest.integration.config.mts", 10 | "src/**/*.ts", 11 | "src/**/*.unit.test.ts" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /testing/setup/vitest.config.mts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | cacheDir: '../../node_modules/.vite/testing-vitest-setup/unit', 5 | root: __dirname, 6 | test: { 7 | coverage: { 8 | provider: 'v8', 9 | reporter: ['text', 'lcov'], 10 | reportsDirectory: '../../coverage/testing-vitest-setup/unit', 11 | exclude: ['mocks/**', '**/types.ts', '**/__snapshots__/**'], 12 | }, 13 | watch: false, 14 | globals: true, 15 | environment: 'node', 16 | include: ['src/**/*.unit.test.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], 17 | reporters: ['default'], 18 | passWithNoTests: true, 19 | testTimeout: 25_000, 20 | }, 21 | }); 22 | -------------------------------------------------------------------------------- /testing/setup/vitest.integration.config.mts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | cacheDir: '../../node_modules/.vite/testing-vitest-setup/integration', 5 | root: __dirname, 6 | test: { 7 | coverage: { 8 | provider: 'v8', 9 | reporter: ['text', 'lcov'], 10 | reportsDirectory: '../../coverage/testing-vitest-setup/integration', 11 | exclude: ['mocks/**', '**/types.ts', '**/__snapshots__/**'], 12 | }, 13 | watch: false, 14 | globals: true, 15 | environment: 'node', 16 | include: ['src/**/*.integration.test.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], 17 | reporters: ['default'], 18 | passWithNoTests: true, 19 | testTimeout: 25_000, 20 | }, 21 | }); 22 | -------------------------------------------------------------------------------- /testing/utils/README.md: -------------------------------------------------------------------------------- 1 | # testing-utils 2 | 3 | This library provides a set of helper functions for testing. 4 | 5 | The many content divides into: 6 | 7 | - constants 8 | - mock helper 9 | - utils for OS dependent APIs 10 | 11 | ## Building 12 | 13 | Run `nx build testing-utils` to build the library. 14 | 15 | ## Running unit tests 16 | 17 | Run `nx test testing-utils` to execute the unit tests via [Vitest](https://vitest.dev/). 18 | -------------------------------------------------------------------------------- /testing/utils/eslint.config.js: -------------------------------------------------------------------------------- 1 | const nextEslintConfig = require('./eslint.next.config'); 2 | 3 | // 🚨 DO NOT EDIT THIS FILE MANUALLY! 🚨 4 | // Run `pnpm eslint-next/nx` to update or remove this file if all rules pass. 5 | // Add new rules globally to the `eslint.config.js` or locally to the `eslint.next.config.js` file. 6 | // For details, refer to: tools/scripts/eslint-next/README.md 7 | module.exports = [ 8 | ...nextEslintConfig, 9 | { 10 | files: ['**/*'], 11 | rules: { 12 | // ❌ Errors: 1 13 | '@nx/dependency-checks': 'off', // ❌ 1 error 🛠️ 14 | }, 15 | }, 16 | ]; 17 | -------------------------------------------------------------------------------- /testing/utils/eslint.next.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('../../eslint.config.js'); 2 | 3 | module.exports = [ 4 | ...baseConfig, 5 | { 6 | files: ['**/*.ts'], 7 | languageOptions: { 8 | parserOptions: { 9 | projectService: true, 10 | tsconfigRootDir: __dirname, 11 | }, 12 | }, 13 | }, 14 | { 15 | files: ['**/*.json'], 16 | rules: { 17 | '@nx/dependency-checks': [ 18 | 'error', 19 | { 20 | ignoredFiles: [ 21 | '{projectRoot}/eslint.config.{js,cjs,mjs}', 22 | '{projectRoot}/vite.config.{js,ts,mjs,mts}', 23 | ], 24 | }, 25 | ], 26 | }, 27 | languageOptions: { 28 | parser: require('jsonc-eslint-parser'), 29 | }, 30 | }, 31 | ]; 32 | -------------------------------------------------------------------------------- /testing/utils/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@ng-rspack/testing-utils", 3 | "version": "0.0.1", 4 | "private": true, 5 | "main": "./dist/index.js", 6 | "module": "./dist/index.js", 7 | "types": "./dist/index.d.ts", 8 | "typings": "./dist/index.d.ts", 9 | "exports": { 10 | "./package.json": "./package.json", 11 | ".": { 12 | "types": "./dist/index.d.ts", 13 | "import": "./dist/index.js" 14 | } 15 | }, 16 | "dependencies": { 17 | "ts-morph": "^24.0.0", 18 | "typescript": "5.6.3" 19 | }, 20 | "devDependencies": { 21 | "vite-plugin-dts": "^4.5.0" 22 | }, 23 | "nx": { 24 | "sourceRoot": "testing/utils/src", 25 | "projectType": "library", 26 | "name": "testing-utils", 27 | "targets": {} 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /testing/utils/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './lib/source-file-from.code.js'; 2 | export * from './lib/os-agnostic-paths.js'; 3 | export * from './lib/constants.js'; 4 | export * from './lib/e2e-setup.js'; 5 | -------------------------------------------------------------------------------- /testing/utils/src/lib/constants.ts: -------------------------------------------------------------------------------- 1 | export const MEMFS_VOLUME = '/memfs'; 2 | -------------------------------------------------------------------------------- /testing/utils/src/lib/source-file-from.code.ts: -------------------------------------------------------------------------------- 1 | import { Project } from 'ts-morph'; 2 | import type { SourceFile as TsSourceFile } from 'typescript'; 3 | 4 | export const sourceFileFromCode = ({ 5 | path, 6 | code, 7 | }: { 8 | path?: string; 9 | code: string; 10 | }) => { 11 | const project = new Project({ useInMemoryFileSystem: true }); 12 | const tsMorphSourceFile = project.createSourceFile(path ?? 'cmp.ts', code); 13 | return tsMorphSourceFile as unknown as TsSourceFile; 14 | }; 15 | -------------------------------------------------------------------------------- /testing/utils/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "files": [], 4 | "include": [], 5 | "references": [ 6 | { 7 | "path": "./tsconfig.lib.json" 8 | }, 9 | { 10 | "path": "./tsconfig.spec.json" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /testing/utils/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "baseUrl": ".", 5 | "rootDir": "src", 6 | "outDir": "dist", 7 | "tsBuildInfoFile": "dist/tsconfig.lib.tsbuildinfo", 8 | "emitDeclarationOnly": false, 9 | "types": ["node", "vite/client"] 10 | }, 11 | "include": ["src/**/*.ts"], 12 | "references": [], 13 | "exclude": [ 14 | "vite.config.ts", 15 | "vite.config.mts", 16 | "vitest.config.ts", 17 | "vitest.config.mts", 18 | "src/**/*.test.ts", 19 | "src/**/*.spec.ts", 20 | "src/**/*.test.tsx", 21 | "src/**/*.spec.tsx", 22 | "src/**/*.test.js", 23 | "src/**/*.spec.js", 24 | "src/**/*.test.jsx", 25 | "src/**/*.spec.jsx" 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /testing/utils/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "types": ["vitest/globals", "vitest/importMeta", "vite/client", "node"] 6 | }, 7 | "include": ["vite.config.ts", "src/**/*.ts", "src/**/*.unit.test.ts"] 8 | } 9 | -------------------------------------------------------------------------------- /testing/utils/vitest.config.mts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | cacheDir: '../../node_modules/.vite/testing-utils/unit', 5 | root: __dirname, 6 | test: { 7 | coverage: { 8 | provider: 'v8', 9 | reporter: ['text', 'lcov'], 10 | reportsDirectory: '../../coverage/testing-utils/unit', 11 | exclude: ['mocks/**', '**/types.ts', '**/__snapshots__/**'], 12 | }, 13 | watch: false, 14 | globals: true, 15 | environment: 'node', 16 | include: ['src/**/*.unit.test.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], 17 | reporters: ['default'], 18 | passWithNoTests: true, 19 | testTimeout: 25_000, 20 | }, 21 | }); 22 | -------------------------------------------------------------------------------- /testing/utils/vitest.integration.config.mts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | root: __dirname, 5 | cacheDir: '../../node_modules/.vite/testing-utils/integration', 6 | plugins: [], 7 | test: { 8 | watch: false, 9 | globals: true, 10 | environment: 'node', 11 | include: ['src/**/*.integration.test.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], 12 | passWithNoTests: true, 13 | reporters: ['default'], 14 | coverage: { 15 | provider: 'v8', 16 | reporter: ['text', 'lcov'], 17 | reportsDirectory: '../../coverage/testing-utils/integration', 18 | exclude: ['mocks/**', '**/types.ts', '**/__snapshots__/**'], 19 | }, 20 | }, 21 | }); 22 | -------------------------------------------------------------------------------- /testing/vitest-setup/README.md: -------------------------------------------------------------------------------- 1 | # testing-vitest-setup 2 | 3 | This library provides a set of setup scripts for testing. 4 | As this package is never directly referenced, but only it's files it does not maintain a `index.ts` entry point. 5 | 6 | ## The many content divides into: 7 | 8 | - **Setup files** - obey to the naming pattern `-setup-file.ts` and should be used in a `vite.config.ts` testing config under the `setupFiles` property. 9 | - **Global setup files** - obey to the naming pattern `-global-setup-file.ts` and should be used in a `vite.config.ts` testing config under the `globalSetup` property. 10 | -------------------------------------------------------------------------------- /testing/vitest-setup/eslint.config.js: -------------------------------------------------------------------------------- 1 | const nextEslintConfig = require('./eslint.next.config'); 2 | 3 | // 🚨 DO NOT EDIT THIS FILE MANUALLY! 🚨 4 | // Run `pnpm eslint-next/nx` to update or remove this file if all rules pass. 5 | // Add new rules globally to the `eslint.config.js` or locally to the `eslint.next.config.js` file. 6 | // For details, refer to: tools/scripts/eslint-next/README.md 7 | module.exports = [ 8 | ...nextEslintConfig, 9 | { 10 | files: ['**/*'], 11 | rules: { 12 | // ❌ Errors: 1 13 | '@nx/dependency-checks': 'off', // ❌ 1 error 🛠️ 14 | }, 15 | }, 16 | ]; 17 | -------------------------------------------------------------------------------- /testing/vitest-setup/eslint.next.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('../../eslint.config.js'); 2 | 3 | module.exports = [ 4 | ...baseConfig, 5 | { 6 | files: ['**/*.ts'], 7 | languageOptions: { 8 | parserOptions: { 9 | projectService: true, 10 | tsconfigRootDir: __dirname, 11 | }, 12 | }, 13 | }, 14 | { 15 | files: ['**/*.json'], 16 | rules: { 17 | '@nx/dependency-checks': [ 18 | 'error', 19 | { 20 | ignoredFiles: [ 21 | '{projectRoot}/eslint.config.{js,cjs,mjs}', 22 | '{projectRoot}/vite.config.{js,ts,mjs,mts}', 23 | ], 24 | }, 25 | ], 26 | }, 27 | languageOptions: { 28 | parser: require('jsonc-eslint-parser'), 29 | }, 30 | }, 31 | ]; 32 | -------------------------------------------------------------------------------- /testing/vitest-setup/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@ng-rspack/testing-vitest-setup", 3 | "version": "0.0.1", 4 | "dependencies": { 5 | "vitest": "^1.3.1", 6 | "memfs": "^4.17.0" 7 | }, 8 | "devDependencies": { 9 | "vite-plugin-dts": "^4.5.0" 10 | }, 11 | "main": "./dist/index.js", 12 | "typings": "./dist/index.d.ts", 13 | "private": true, 14 | "nx": { 15 | "sourceRoot": "testing/vitest-setup/src", 16 | "projectType": "library", 17 | "name": "testing-vitest-setup" 18 | }, 19 | "exports": { 20 | "./package.json": "./package.json", 21 | ".": { 22 | "types": "./dist/index.d.ts", 23 | "import": "./dist/index.js" 24 | } 25 | }, 26 | "types": "./dist/index.d.ts", 27 | "module": "./dist/index.js" 28 | } 29 | -------------------------------------------------------------------------------- /testing/vitest-setup/src/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-rspack/c7c5b1259eb2ff33e68561eb9025f5dca2fe790d/testing/vitest-setup/src/index.ts -------------------------------------------------------------------------------- /testing/vitest-setup/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "files": [], 4 | "include": [], 5 | "references": [ 6 | { 7 | "path": "../utils" 8 | }, 9 | { 10 | "path": "./tsconfig.lib.json" 11 | }, 12 | { 13 | "path": "./tsconfig.spec.json" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /testing/vitest-setup/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "baseUrl": ".", 5 | "rootDir": "src", 6 | "outDir": "dist", 7 | "tsBuildInfoFile": "dist/tsconfig.lib.tsbuildinfo", 8 | "emitDeclarationOnly": false, 9 | "types": ["node", "vite/client"] 10 | }, 11 | "include": ["src/**/*.ts"], 12 | "exclude": [ 13 | "vite.config.ts", 14 | "vite.config.mts", 15 | "vitest.config.ts", 16 | "vitest.config.mts", 17 | "src/**/*.test.ts", 18 | "src/**/*.spec.ts", 19 | "src/**/*.test.tsx", 20 | "src/**/*.spec.tsx", 21 | "src/**/*.test.js", 22 | "src/**/*.spec.js", 23 | "src/**/*.test.jsx", 24 | "src/**/*.spec.jsx" 25 | ], 26 | "references": [ 27 | { 28 | "path": "../utils/tsconfig.lib.json" 29 | } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /testing/vitest-setup/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "types": ["vitest/globals", "vitest/importMeta", "vite/client", "node"] 6 | }, 7 | "include": ["vite.config.ts", "src/**/*.ts", "src/**/*.unit.test.ts"] 8 | } 9 | -------------------------------------------------------------------------------- /testing/vitest-setup/vitest.config.mts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | cacheDir: '../../node_modules/.vite/testing-vitest-setup/unit', 5 | root: __dirname, 6 | test: { 7 | coverage: { 8 | provider: 'v8', 9 | reporter: ['text', 'lcov'], 10 | reportsDirectory: '../../coverage/testing-vitest-setup/unit', 11 | exclude: ['mocks/**', '**/types.ts', '**/__snapshots__/**'], 12 | }, 13 | watch: false, 14 | globals: true, 15 | environment: 'node', 16 | include: ['src/**/*.unit.test.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], 17 | reporters: ['default'], 18 | passWithNoTests: true, 19 | testTimeout: 25_000, 20 | }, 21 | }); 22 | -------------------------------------------------------------------------------- /testing/vitest-setup/vitest.integration.config.mts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | cacheDir: '../../node_modules/.vite/testing-vitest-setup/integration', 5 | root: __dirname, 6 | test: { 7 | coverage: { 8 | provider: 'v8', 9 | reporter: ['text', 'lcov'], 10 | reportsDirectory: '../../coverage/testing-vitest-setup/integration', 11 | exclude: ['mocks/**', '**/types.ts', '**/__snapshots__/**'], 12 | }, 13 | watch: false, 14 | globals: true, 15 | environment: 'node', 16 | include: ['src/**/*.integration.test.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], 17 | reporters: ['default'], 18 | passWithNoTests: true, 19 | testTimeout: 25_000, 20 | }, 21 | }); 22 | -------------------------------------------------------------------------------- /tools/eslint-rules/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "eslint-rules", 3 | "$schema": "../../node_modules/nx/schemas/project-schema.json", 4 | "sourceRoot": "tools/eslint-rules", 5 | "targets": {} 6 | } 7 | -------------------------------------------------------------------------------- /tools/eslint-rules/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "moduleResolution": "node16", 5 | "module": "node16" 6 | }, 7 | "files": [], 8 | "include": [], 9 | "references": [ 10 | { 11 | "path": "./tsconfig.lint.json" 12 | }, 13 | { 14 | "path": "./tsconfig.spec.json" 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /tools/eslint-rules/tsconfig.lint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "types": ["node"] 6 | }, 7 | "exclude": ["**/*.spec.ts"], 8 | "include": ["**/*.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /tools/eslint-rules/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "outDir": "./out-tsc/vitest", 5 | "types": ["vitest", "node"] 6 | }, 7 | "include": ["vitest.config.ts", "**/unit.test.ts", "**/integration.test.ts"] 8 | } 9 | -------------------------------------------------------------------------------- /tools/eslint-rules/utils/constants.ts: -------------------------------------------------------------------------------- 1 | export const REPO_SOURCE_FILE_PATH = 2 | 'https://github.com/nrwl/angular-rspack/blob/main'; 3 | -------------------------------------------------------------------------------- /tools/scripts/stop-local-registry.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This script stops the local registry for e2e testing purposes. 3 | * It is meant to be called in jest's globalTeardown. 4 | */ 5 | 6 | export default () => { 7 | if (global.stopLocalRegistry) { 8 | global.stopLocalRegistry(); 9 | } 10 | }; 11 | -------------------------------------------------------------------------------- /tools/tsconfig.tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.base.json", 3 | "compilerOptions": { 4 | "outDir": "../dist/out-tsc/tools", 5 | "rootDir": ".", 6 | "module": "ESNext", 7 | "target": "es5", 8 | "types": ["node"], 9 | "importHelpers": false, 10 | "esModuleInterop": true, 11 | "downlevelIteration": true 12 | }, 13 | "include": ["**/*.ts"] 14 | } 15 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.base.json", 3 | "compileOnSave": false, 4 | "files": [], 5 | "references": [ 6 | { 7 | "path": "./tools/eslint-rules" 8 | }, 9 | { 10 | "path": "./e2e/rsbuild-csr-scss-e2e" 11 | }, 12 | { 13 | "path": "./e2e/rsbuild-csr-css-e2e" 14 | }, 15 | { 16 | "path": "./e2e/rsbuild-ssr-css-e2e" 17 | }, 18 | { 19 | "path": "./apps/docs" 20 | }, 21 | { 22 | "path": "./e2e/rsbuild-csr-less-e2e" 23 | }, 24 | { 25 | "path": "./testing/setup" 26 | }, 27 | { 28 | "path": "./testing/vitest-setup" 29 | }, 30 | { 31 | "path": "./testing/utils" 32 | }, 33 | { 34 | "path": "./packages/angular-rspack" 35 | }, 36 | { 37 | "path": "./packages/angular-rspack-compiler" 38 | }, 39 | { 40 | "path": "./packages/angular-rsbuild" 41 | } 42 | ] 43 | } 44 | -------------------------------------------------------------------------------- /vitest.workspace.ts: -------------------------------------------------------------------------------- 1 | export default ['**/*/vite.config.ts', '**/*/vitest.config.ts']; 2 | --------------------------------------------------------------------------------