Skip to content

Instantly share code, notes, and snippets.

@giann
Created May 29, 2019 06:16
Show Gist options
  • Save giann/e36cfde839fd747ac343f66927fb995e to your computer and use it in GitHub Desktop.
Save giann/e36cfde839fd747ac343f66927fb995e to your computer and use it in GitHub Desktop.
vue.config.js to use Fengari with Vue
const path = require("path");
module.exports = {
configureWebpack: {
module: {
rules: [
{
test: /\.lua$/,
oneOf: [
// this applies to <template lang="lua"> in Vue components
{
resourceQuery: /^\?vue/,
loader: "fengari-loader"
},
// this applies to lua imports inside JavaScript
{
loader: "fengari-loader"
}
]
}
]
},
resolve: {
alias: {
"fengari-web": path.resolve("node_modules/fengari-web")
}
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment