@epic-effx/create-application-template-rs
v0.4.0
Published
provides an Rspack + SWC configured application template for you to build upon
Maintainers
Readme
Create Application Template RS
This project aims to provide a configured application template for you to build upon.
All configuration is fully visible and under your control to augment as you see fit.
The template is a typescript enabled React application with a test suite and code linting.
Rust-based 🦀 web bundler Rspack and compiler SWC are utilized for fast bundling and transpiling
See the template running live here.
installation
first install globally
npm install -g @epic-effx/create-application-template-rs@latestthen create your project
npx @epic-effx/create-application-template-rs --name={my-project}usage
webpack is used for code bundling and the development server
run development server and test suite (on http://localhost:3333 by default)
npm run devbuild static bundle
npm run buildcompiler 🚀
this project uses React 19 with React Compiler opt-in
it takes advantage of the React Compiler's automatic optimization
React Compiler's ESLint integration is also included via eslint-plugin-react-hooks
babel-loader is used for compilation; see Rspack docs
tsconfig
focused on type checking; SWC is used for transpiling
git hooks
scripts in .husky/pre-commit are run on commits for quality control
run npm prepare to enable husky and use the provided pre-commit file
warning: running npx husky init will re-initiate husky and overwrite the provided pre-commit file
test suite
to create a test follow this file naming format: *.{spec,test}.{ts,tsx}
run the test suite stand alone like so
npm run testcode linting
linting rules are in .eslintrc.js; install the ESLint plugin if using vscode
npm run lintcss linting rules are in .stylelintrc.js; install the Stylelint plugin if using vscode
npm run stylelintstyles
styling is done using the style-components module, but straight CSS is supported
after instillation it is recommended to proceed using styled-components or CSS, but not both
if you proceed with styled-components:
- remove the single
.cssexample in/src/styles/ - that's it!
if you prefer CSS:
- alter
.stylelintrc.jsand.husky/pre-commitper the files' notes - remove
.tsfiles from/src/styles/or "recreate" them in.css
environmental settings
access environmental variables in code like so
console.log(process.env.PORT)build settings
some environmental setting are explicitly set in the npm scripts using cross-env
developmentwhen running the dev serverproductionwhen running the build
these variables set the OS env as early as possible and control build tool behavior
they are set in the scripts to guarantee consistent, production-safe builds across local, CI, and hosting environments
.env variables
add new or alter existing environmental variables via the .env file
.env is intended for application runtime configuration - not build tool configuration
the following variables exist in the default configuration and can be altered
develop (dev server)
# optional
PORT={port number}
INLINE_SIZE_LIMIT={default is 10000}production (build)
# optional
INLINE_SIZE_LIMIT={default is 10000}dependency overrides
this version includes minimal npm overrides to patch known transitive vulnerabilities in tooling
they are intentionally limited to patch-level upgrades within the same major
you can remove them in the future by:
- running
npm update - removing the
overridessection - reinstalling dependencies
- running
npm audit
