Code Monkey home page Code Monkey logo

foundryvtt-module-template-hotswap's Introduction

About

A template for creating foundry modules using typescript. Project files are setup to be hot reloaded. Information on hot module replacement: https://webpack.js.org/concepts/hot-module-replacement/

Setup:

About Bundler:
This project uses webpack to bundle your files. What this means is that every script file in src/ will get 'bundled' into one output .js file in dist/. Likewise every static file (.html, .json, etc.) in static/ will get moved to dist.
Because of this you should NOT have your development working directory inside the foundryuser folder. Instead you should follow the instructions below for setting up symantic links between the dist/ folder and foundryuser.

  • Run npm install
  • Rename module.ts to your chosen module name.
  • Rename the references to module.ts in webpack.config.js file. (Line 26)
  • Fill in module.json with actual information.
  • run: npm run build
  • Create a symantic link between the dist/ folder to a module folder in the foundry data modules directory[MODULE_NAME]
    -- Instructions (for windows) -- Open a command prompt and navigate to the foundry data modules directory -- Run: mklink /D MODULE_NAME [DEVELOPMENT_PATH]/dist

A note on typescript, it is completely optional and if you do not wish to use then rename any .ts files and their references to .js.

Usage:

Development: To run with hotswap enabled run the command: npm run start

Release: To ready the project for release run the command: npm run build:production

CD/CI: This template is setup with automatic github release, developed by League of Foundry Developers in their FoundryVtt-Module-Template. https://github.com/League-of-Foundry-Developers/FoundryVTT-Module-Template

Troubleshooting:

Hot Reload force refreshes my page!

  • access foundry through localhost:8080 instead of localhost:30000
  • You might have multiple modules running HMR. It is critical that if you are working on multiple modules that only a single module is using hot module reload at a time.

Credits:

Used webpack and setup files as reference: https://github.com/anvil-vtt/FateX
Used github workflow and template reference: https://github.com/League-of-Foundry-Developers/FoundryVTT-Module-Template

foundryvtt-module-template-hotswap's People

Contributors

blackcloud010 avatar jmhnilbog 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.