{"id":14067105,"url":"https://github.com/davidruvolo51/shiny-webpack-template","last_synced_at":"2026-05-15T07:02:47.519Z","repository":{"id":119355896,"uuid":"357324519","full_name":"davidruvolo51/shiny-webpack-template","owner":"davidruvolo51","description":"An example setup for Shiny applications that use Webpack","archived":false,"fork":false,"pushed_at":"2022-03-04T15:09:04.000Z","size":449,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-13T18:46:10.935Z","etag":null,"topics":["r","shiny","shiny-apps","shiny-template","webpack"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidruvolo51.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-12T20:04:58.000Z","updated_at":"2022-05-14T04:15:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"083cdf3b-dd5d-462a-84db-47f8985c6c40","html_url":"https://github.com/davidruvolo51/shiny-webpack-template","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidruvolo51%2Fshiny-webpack-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidruvolo51%2Fshiny-webpack-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidruvolo51%2Fshiny-webpack-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidruvolo51%2Fshiny-webpack-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidruvolo51","download_url":"https://codeload.github.com/davidruvolo51/shiny-webpack-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241623716,"owners_count":19992721,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["r","shiny","shiny-apps","shiny-template","webpack"],"created_at":"2024-08-13T07:05:26.165Z","updated_at":"2026-05-15T07:02:47.455Z","avatar_url":"https://github.com/davidruvolo51.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"# Shiny + Webpack\r\n\r\nThe `shiny-webpack-template` contains the basic structure for creating Shiny applications using the application bundler [webpack](https://webpack.js.org). Using these tools is useful for optimizing CSS and JavaScript files, as well as integrating many other JavaScript plugins and libraries. Some of the key features are listed below.\r\n\r\n- ✨ Sass enabled\r\n- 🔥 Hot Module Replacement\r\n- 📚 Development and production environments\r\n- 📦 Bundling your shiny as an R package\r\n- 😍 And much more!\r\n\r\nThis application uses the following tools.\r\n\r\n- [Webpack](https://webpack.js.org)\r\n- [Node and NPM](https://nodejs.org/en/)\r\n- [Yarn](https://yarnpkg.com/en/)\r\n- [pnpm](https://github.com/pnpm/pnpm)\r\n\r\nThis workspace is geared towards vscode, but can easily be adapted into a R project. If you decide to use vscode, I am using [radian](https://github.com/randy3k/radian) and [languageserver](https://github.com/REditorSupport/languageserver). Additional extensions can be found in the `.code-workspace` config file.\r\n\r\n## Getting Started\r\n\r\n### 1. Install Node and NPM\r\n\r\nMake sure [Node and NPM](https://nodejs.org/en/) are installed on your machine. You may also use [Yarn](https://yarnpkg.com/en/). To test the installation or to see if these tools are already installed on your machine, run the following commands in the terminal.\r\n\r\n```shell\r\nnode -v\r\nnpm -v\r\nyarn -v\r\n```\r\n\r\n### 2. Clone the `shiny-webpack-template` repository\r\n\r\n```shell\r\ngit clone https://github.com/davidruvolo51/shiny-webpack-template\r\n```\r\n\r\n### 3. Install dependencies\r\n\r\nNext, install the npm packages that are required to run the app locally. I have decided to use [pnpm](https://github.com/pnpm/pnpm) to manage packages on my machine and across projects. To install `pnpm`, run the following command.\r\n\r\n```shell\r\nnpm install -g pnpm\r\n```\r\n\r\nYou will need to install the dependencies in the root directory.\r\n\r\n```shell\r\npnpm install\r\n```\r\n\r\nIf you prefer to use `npm`, use `npm` instead of `pnpm`.\r\n\r\n### 4. Working in development mode\r\n\r\nFor developing your application, I recommend creating two terminals in the same window. Use one to run the Shiny and the other to run node. Use the following scripts to start the dev servers.\r\n\r\n```shell\r\nyarn start  # node\r\nyarn shiny  # shiny\r\n```\r\n\r\nThe application will be served at `http://localhost:8000`.\r\n\r\n### 5. Building for production\r\n\r\nWhen you are ready to deploy your application, run the build script. This will compile all of javascript, scss, etc. for production.\r\n\r\n```shell\r\nyarn build\r\n```\r\n\r\nIf you need additional assets (e.g., fonts), you will need to configure this manually.\r\n\r\n## Notes\r\n\r\n- Write all javascript and scss in the `src` folder. Webpack is configured to render an `index.js` and `index.css` files into `inst/www/`.\r\n- If you have images, place them in `inst/images`. Shiny is automatically configured to add the resource path at `images/`. In your shiny app, write the file path as `src=\"images/my_image.png\"`\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidruvolo51%2Fshiny-webpack-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidruvolo51%2Fshiny-webpack-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidruvolo51%2Fshiny-webpack-template/lists"}