From f39ed37e734c74890c810dc669a1b4d8b7ebf3db Mon Sep 17 00:00:00 2001 From: Taso Date: Mon, 8 Feb 2021 23:02:25 -0500 Subject: [PATCH] chore(phone/build): Removed unnecessary files --- .../{webpack.prod.js => prod.config.js} | 0 phone/webpack/webpack.fxmanifest.plugin.js | 55 ------------------- 2 files changed, 55 deletions(-) rename phone/webpack/{webpack.prod.js => prod.config.js} (100%) delete mode 100644 phone/webpack/webpack.fxmanifest.plugin.js diff --git a/phone/webpack/webpack.prod.js b/phone/webpack/prod.config.js similarity index 100% rename from phone/webpack/webpack.prod.js rename to phone/webpack/prod.config.js diff --git a/phone/webpack/webpack.fxmanifest.plugin.js b/phone/webpack/webpack.fxmanifest.plugin.js deleted file mode 100644 index 6a8c442..0000000 --- a/phone/webpack/webpack.fxmanifest.plugin.js +++ /dev/null @@ -1,55 +0,0 @@ -const path = require("path"); - -const defaultOptions = { - itemsFromCompilation: (compilation) => Object.keys(compilation.assets), - output: "phonemanifest.lua", -}; - -const makeDefault = (object, ...sources) => { - object = Object(object); - sources.forEach((source) => { - if (source != null) { - source = Object(source); - for (const key in source) { - const value = object[key]; - if ( - value === undefined || - (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key)) - ) { - object[key] = source[key]; - } - } - } - }); - return object; -}; - -function ResourceManifestPlugin(options) { - makeDefault(this, options, defaultOptions); -} - -const pluginName = "fivem-manifest-plugin"; - -ResourceManifestPlugin.prototype.apply = function (compiler) { - const { itemsFromCompilation, output } = this; - compiler.hooks.emit.tap(pluginName, (compilation) => { - const assets = itemsFromCompilation(compilation); - const result = format( - assets, - compilation.options.output.path.split("\\").pop() - ); - compilation.assets[output] = { - source: () => Buffer.from(result), - size: () => Buffer.byteLength(result), - }; - }); -}; - -function format(assets, path) { - return ` -ui_page "${path}/index.html" -files{${assets.map((asset) => `"${path}/${asset}"`).join(",")}} - `; -} - -module.exports = ResourceManifestPlugin;