Skip to content

A Webpack plugin for bundling code compatible with the alt:V client runtime.

Notifications You must be signed in to change notification settings

micaww/altv-webpack-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

alt:V Webpack Plugin

Why?

Webpack v4 does not support outputting external dependencies as ESM imports. The alt:V client-side engine will only allow you to import the alt runtime using an ESM import. Webpack v5 will have this ability, but this plugin can be used until then.

What's it do?

This plugin will take all of your alt:V dependencies (alt, alt-client, alt-server), marks them as external dependencies, and adds a single ESM import at the top of each output file that will be used in place of all of these modules.

Installation

Download the plugin

The plugin is available via npm:

npm i -D altv-webpack-plugin

Add the plugin to your Webpack config

const AltvWebpackPlugin = require('altv-webpack-plugin');

module.exports = {
    entry: './src/client/index.js',
    plugins: [
        new AltvWebpackPlugin() // no configuration needed
    ]
    ...
};

About

A Webpack plugin for bundling code compatible with the alt:V client runtime.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published