Skip to content

Commit

Permalink
feat: add webpack
Browse files Browse the repository at this point in the history
This will allow everything to be loaded and used in FiveM.
  • Loading branch information
TGRHavoc committed Jun 9, 2019
1 parent 744ac41 commit 6b0e711
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
4 changes: 3 additions & 1 deletion __resource.lua
@@ -1,6 +1,8 @@
resource_manifest_version "44febabe-d386-4d18-afbe-5e627f4af937"

dependency "yarn"
dependency "webpack"
webpack_config "webpack.config.js"

client_scripts{
"client/client.lua",
Expand All @@ -19,7 +21,7 @@ exports {
}

server_scripts{
"src/server.js",
"dist/server.js",
"server/update_check.lua",
"server/wrapper.lua"
}
25 changes: 25 additions & 0 deletions webpack.config.js
@@ -0,0 +1,25 @@
const webpack = require("webpack");
const path = require("path");

const config = {
entry: "./src/server.js",
output: {
path: path.resolve(__dirname, "dist"),
filename: "server.js"
},
resolve: {
alias: {
LivemapSocketController: path.resolve(__dirname, "src", "sockets.js"),
LivemapBlipController: path.resolve(__dirname, "src", "blips.js")
}
},
plugins: [
new webpack.DefinePlugin({ "global.GENTLY": false })
],
optimization: {
minimize: false
},
target: "node"
};

module.exports = config;

0 comments on commit 6b0e711

Please sign in to comment.