Skip to content

Latest commit

 

History

History

webpack-plugin

@vextjs/webpack-plugin npm

Integrates the Venice Unleashed WebUI compiler into Webpack, formerly known as VextPack

  • Automatically build a WebUI package (ui.vuic) after running a WebPack build.
  • Support for hot module replacements / hot reloads by generating a proxied UI.

Installation

With npm

npm i -D @vextjs/webpack-plugin

With yarn

yarn -D @vextjs/webpack-plugin

Usage

By default, this plugin is configured to put the ui.vuic file in the parent folder (the root folder of your mod).

We recommend your mod to have the following mod structure:

mods/<Your Mod>
|--ext
|  |--Client            Client Lua code
|  |--Server            Server Lua code
|  `--Shared            Shared Lua code
|--WebUI                All your WebUI source code
|  |--src               WebUI code
|  |--package.json      NPM's configuration and dependencies
|  `--webpack.config.js Webpack's configuration
|--mod.json             Mod metadata
`--ui.vuic              Generated by this plugin

This plugin can be installed by adding the following to your Webpack configuration

// webpack.config.js
const { VextPackPlugin } = require('@vextjs/webpack-plugin');

module.exports = {
  // ...
  plugins: [
    new VextPackPlugin({
      // OPTIONAL: Specify the location where the ui.vuic should be placed, defaults to '../'
      outputPath: '../',

      // OPTIONAL: Make a hot reloadable ui build, this creates a proxy ui that remotely loads the real ui
      hotReloadSupport: process.env.NODE_ENV !== 'production',
    }),
  ],
};

Development

Building

Run nx build webpack-plugin to build the library.

Running unit tests

Run nx test webpack-plugin to execute the unit tests via Jest.