{"id":13895313,"url":"https://github.com/fengari-lua/fengari-loader","last_synced_at":"2025-04-25T14:32:01.040Z","repository":{"id":56534462,"uuid":"111355733","full_name":"fengari-lua/fengari-loader","owner":"fengari-lua","description":"Webpack loader for fengari","archived":false,"fork":false,"pushed_at":"2021-06-23T16:12:05.000Z","size":180,"stargazers_count":27,"open_issues_count":2,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-25T11:21:39.146Z","etag":null,"topics":["fengari","javascript","lua","webpack","webpack-loader"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fengari-lua.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-20T03:10:40.000Z","updated_at":"2024-01-14T15:41:41.000Z","dependencies_parsed_at":"2022-08-15T20:31:05.183Z","dependency_job_id":null,"html_url":"https://github.com/fengari-lua/fengari-loader","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fengari-lua%2Ffengari-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fengari-lua%2Ffengari-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fengari-lua%2Ffengari-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fengari-lua%2Ffengari-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fengari-lua","download_url":"https://codeload.github.com/fengari-lua/fengari-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250834109,"owners_count":21494912,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fengari","javascript","lua","webpack","webpack-loader"],"created_at":"2024-08-06T18:02:07.727Z","updated_at":"2025-04-25T14:32:00.205Z","avatar_url":"https://github.com/fengari-lua.png","language":"JavaScript","readme":"[![Build Status](https://travis-ci.org/fengari-lua/fengari-loader.svg?branch=master)](https://travis-ci.org/fengari-lua/fengari-loader)\n[![npm](https://img.shields.io/npm/v/fengari-loader.svg)](https://npmjs.com/package/fengari-loader)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![#fengari on libera.chat](https://img.shields.io/badge/chat-%23fengari-brightgreen)](https://web.libera.chat/?channels=#fengari)\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://fengari.io/\"\u003e\u003cimg height=\"200\" src=\"https://fengari.io/static/images/logo.png\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/webpack/webpack\"\u003e\u003cimg width=\"200\" height=\"200\" src=\"https://webpack.js.org/assets/icon-square-big.svg\"\u003e\u003c/a\u003e\n  \u003ch1\u003eFengari Loader\u003c/h1\u003e\n\u003c/div\u003e\n\n[Fengari](https://fengari.io/) is a lua VM written in Javascript. [Webpack](http://webpack.js.org/) is a piece of Javascript tooling to compile scripts and other assets together.\nThis repository contains a [webpack loader](https://webpack.js.org/concepts/#loaders) that allows you to require lua scripts when creating your web page/application.\n\n## Install\n\n```bash\nnpm install fengari-loader fengari-web webpack webpack-cli --save-dev\n```\n\nfengari-loader requires fengari-web and webpack as peerDependency. Thus you are able to control the versions accurately.\n\n\n## Usage\n\n**src/mycode.lua**\n```js\nreturn {\n  42\n}\n```\n\n**src/index.js**\n```js\nimport mycode from './mycode.lua'\n```\n\n**webpack.config.js**\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.lua$/,\n        use: [\n          { loader: \"fengari-loader\" }\n        ]\n      }\n    ]\n  }\n}\n```\n\n\n## Options\n\n|Name|Type|Default|Description|\n|:--:|:--:|:-----:|:----------|\n|**`dependencies`**|`{Object\\|undefined}`|`undefined`|If `undefined`, analyse the required lua file for `require` calls. Otherwise, manually specifies the dependencies as a map from require string to webpack module name|\n|**`strip`**|`{Boolean}`|`false`|If `true`, emit stripped lua bytecode instead of source|\n\n\n## How does it work?\n\nfengari-loader [preloads](https://www.lua.org/manual/5.3/manual.html#pdf-package.preload) lua modules into [fengari-web](https://github.com/fengari-lua/fengari-web)'s global state.\n\nAdditionally, fengari-loader analyses lua code for calls to the lua global `require`, and adds the require strings as dependencies to the current webpack module.\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffengari-lua%2Ffengari-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffengari-lua%2Ffengari-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffengari-lua%2Ffengari-loader/lists"}