Giter Club home page Giter Club logo

minecraft-addon-toolchain-webpack's Introduction

minecraft-addon-toolchain-webpack

Webpack

Adds support for modern JavaScript features not supported by the Minecraft Scripting Engine, such as modules and multi-file projects.

This was heavily based on minecraft-addon-toolchain-browserify, but was adapted to use webpack.

Installing

npm install --save-dev minecraft-addon-toolchain-webpack

Adding to the toolchain

const MinecraftAddonBuilder = require('minecraft-addon-toolchain/v1')
const WebpackSupport = require('minecraft-addon-toolchain-webpack')

const builder = new MinecraftAddonBuilder(<youraddonname>)
builder.addPlugin(new WebpackSupport())

module.exports = builder.configureEverythingForMe();

Usage

You can view an example of how this can be used on the original package's README.

Configuration

You can override the settings passed to Babelify any of the following settings the BrowserifySupport object.

const MinecraftAddonBuilder = require('minecraft-addon-toolchain/v1')
const WebpackSupport = require('minecraft-addon-toolchain-webpack')

const builder = new MinecraftAddonBuilder(<youraddonname>);
const webpackSupport = new WebpackSupport();

/// Modify options that webpack will use
//webpackSupport.webpackOptions

/// Enable minification and other enhancements
//webpackSupport.webpackOptions.mode = 'production'

/// Modify the rules that webpack will use
// IMPORTANT: Before doing so, check note below.
//webpackSupport.webpackRules

///Enable single file entry (more details below)
//webpackSupport.options.multiEntry = false

/// Change the intermediate output directory
//webpackSupport.intermediateDir = './out/before-webpack'

/// Change the entry point scripts that will be bundled.
//webpackSupport.entryPoints = ['scripts/client/*.js', 'scripts/server/*.js']

/// Add additional files to be bundled
//webpackSupport.bundleSources = ["scripts/**/*.js" ];

builder.addPlugin(webpackSupport)

module.exports = builder.configureEverythingForMe();

*Multiple Entry Files

If this is enabled (see info above) the compiler will only look for the files of ./scripts/client/client.js and ./scripts/server/server.js. This is useful if you want to only have one file as the output. By default this is disabled and will work exactly like minecraft-addon-toolchain-browserify.

For further information about the various configuration options provided by the various tools, consult the following links:

field name documentation link
webpackOptions https://webpack.js.org/configuration/

minecraft-addon-toolchain-webpack's People

Contributors

destruc7i0n 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.