Giter Site home page Giter Site logo

neblua's Introduction

NebLua

NebLua is a tiny zero-dependency bundler for Lua. Lua 5.3 supported but it may work for Lua 5.4.

Features

  • Bundle require, loadfile and dofile functions
  • Text import by requireText

Installation

Download single source file from Releases

Usage

Program (recommended)

This is a part of configuration of NebLua's self-build. See /example, ./bundleSelf.lua and /test/bundle/bundle.test.lua

local bundle = require("src.neblua").bundle

bundle {
    entry = "src.neblua",
    output = "./dist/neblua.lua",
    files = {
        "./src/neblua.lua",
        "./src/path.lua",
        "./src/string.lua",
        { path = "./src/templates/template.lua", type = "text" }
    },
    verbose = true,
}

Bundle Options

key value
rootDir root directory of source files
entry entry module name
output output file name
files source files
verbose enable verbose mode

CLI

$ lua neblua-cli [options] [files]
options value function
-e, --entry module name set entry point
-o, --output file name set output file name
--verbose none enable verbose mode
-v, --version none print version

Plans

  • support require
  • support loadfile
  • support dofile
  • error output override
  • string require
  • automatically add required files
  • minify
  • tree shaking

neblua's People

Contributors

tsukina-7mochi avatar github-actions[bot] avatar

neblua's Issues

Automatic module resolution

Feature

Automatically detect files to be bundled (currently given via interface)

Method

  • Parse and scan AST to look up require, dofile and load
  • Use annotation like --[[ @neblua-import foo.lua ]]

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.