GithubHelp home page GithubHelp logo

timelyportfolio / webr-webpack-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from georgestagg/webr-webpack-example

0.0 1.0 0.0 29.95 MB

An example of bundling webR as part of an application using webpack.

License: MIT License

JavaScript 84.83% HTML 15.17%

webr-webpack-example's Introduction

Example of bundling webR and R wasm binaries using webpack

This repo contains an example configuration for bundling webR as part of a wider JavaScript application using webpack. In addition to bundling the webR JavaScript loader, webpack has been configured to also copy the required R wasm binaries, distributed as part of the @r-wasm/webr npm package, to the output directory.

By default, webR will download R wasm binaries from CDN. However, in this example webR is instead configured, using the optional baseUrl and serviceWorkerUrl settings at initialisation, so that the R wasm binaries and R worker scripts are downloaded from the served output directory, rather than from CDN.

Building the example application (Linux/macOS)

  • Clone this repo and cd into the new directory.
  • Install the required JavaScript libraries: npm install.
  • Build the application using webpack: npm run build or npx webpack.
  • Serve the application: npm run serve or npx serve dist.

Once the application has been build and is being served it can be accessed at the URL https://localhost:3000.

Relevant files and directories

  • src/index.html - Example HTML template.
  • src/index.js - Example JavaScript source. WebR is initialised in this file.
  • webpack.config.js - Webpack configuration.
  • dist - Webpack output directory.

webr-webpack-example's People

Contributors

georgestagg avatar timelyportfolio avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.