mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-03 22:16:54 +00:00
chore(phone/build): Removed unnecessary files
This commit is contained in:
1 parent
7b6d49f661
commit
f39ed37e73
2 files changed
-55
No files matched your search
File renamed without changes.
@@ -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;
|
||||
Reference in new issue
Block a user