Skip to content

A webpack plugin for compiling javascript files into a TIC-80 game cartridge

License

Notifications You must be signed in to change notification settings

rehret/tic80-webpack-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tic80-webpack-plugin

A webpack plugin for compiling javascript files into a TIC-80 game cartridge

Usage

Add the plugin to the plugins array in webpack.config.js:

// webpack.config.js
const Tic80Plugin = require('tic80-webpack-plugin');

module.exports = {
    plugins: [
        new Tic80Plugin()
    ]
};

In order for TIC-80 to pick up the exported functions, the libraryType must be 'global' and the globalObject must be 'this':

// game's entry point

function TIC() { ... }

module.exports = {
    TIC
}
// webpack.config.js

module.exports = {
    output: {
        libraryType: 'global',
        globalObject: 'this'
    }
};

Additionally, the output bundle should have the ".js" extension and the input cartridge file should be generated by running save [cart name].js in TIC-80 (this saves the game data as javascript comments).

Configuration

The constructor takes an object with the following properties:

Property Required Default Description
cartridgePath false cartridge.js Path from the current Webpack context to the game cartridge file

License

See LICENSE

About

A webpack plugin for compiling javascript files into a TIC-80 game cartridge

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published