diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index 1a31d77..9d0f582 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -30,8 +30,9 @@ jobs: - name: Bundle files run: | - mv dist oxmysql - zip -r oxmysql-${{ github.event.inputs.tag }}.zip oxmysql + mkdir -p ./temp/oxmysql + cp ./{LICENSE.md,README.md,fxmanifest.lua,lib} ./temp/oxmysql + zip -r oxmysql-${{ github.event.inputs.tag }}.zip ./temp/oxmysql - name: Create Release uses: "marvinpinto/action-automatic-releases@v1.2.1" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f19a5c1..99cebcb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,8 +31,9 @@ jobs: - name: Bundle files run: | - mv dist oxmysql - zip -r oxmysql-${{ env.RELEASE_VERSION }}.zip oxmysql + mkdir -p ./temp/oxmysql + cp ./{LICENSE.md,README.md,fxmanifest.lua,lib} ./temp/oxmysql + zip -r oxmysql-${{ github.event.inputs.tag }}.zip ./temp/oxmysql - name: Create Release uses: "marvinpinto/action-automatic-releases@v1.2.1" diff --git a/package.json b/package.json index ca47353..f4183d8 100644 --- a/package.json +++ b/package.json @@ -1,26 +1,23 @@ { "name": "oxmysql", "version": "1.0.0", - "main": "oxmysql.js", - "description": "node-mysql2 resource for Cfx", + "description": "FXServer to MySQL communication via node-mysql2", "repository": "git@github.com:overextended/oxmysql.git", "author": "dunak-debug <19434539+dunak-debug@users.noreply.github.com>", "license": "GPL-3.0-or-later", + "type": "module", + "private": true, "scripts": { - "build": "webpack", - "watch": "webpack --watch", + "build": "esbuild --bundle --platform=node --target=node16.9.1 src/server/index.js --outfile=dist/server/build.js", + "watch": "esbuild --watch --bundle --platform=node --target=node16.9.1 src/server/index.js --outfile=dist/server/build.js", "postinstall": "patch-package" }, "dependencies": { "@citizenfx/server": "latest", + "esbuild": "^0.14.7", "mysql2": "^2.3.3", + "patch-package": "^6.4.7", "postinstall-postinstall": "^2.1.0" }, - "devDependencies": { - "copy-webpack-plugin": "^10.0.0", - "patch-package": "^6.4.7", - "typescript": "^4.5.2", - "webpack": "^5.64.4", - "webpack-cli": "^4.9.1" - } + "devDependencies": {} } diff --git a/webpack.config.js b/webpack.config.js deleted file mode 100644 index d0a4f6c..0000000 --- a/webpack.config.js +++ /dev/null @@ -1,29 +0,0 @@ -const path = require("path"); -const { DefinePlugin, IgnorePlugin } = require("webpack"); -const CopyPlugin = require("copy-webpack-plugin"); - -module.exports = { - mode: "production", - entry: "./src/index.js", - resolve: { - extensions: [".js"], - }, - plugins: [ - new DefinePlugin({ "global.GENTLY": false }), - new IgnorePlugin({ - resourceRegExp: /^cardinal$/, - contextRegExp: /./, - }), - new CopyPlugin({ - patterns: ["./lua", "./lua", "README.md", "LICENSE.md"], - }), - ], - output: { - filename: "oxmysql.js", - path: path.resolve(__dirname, "dist"), - }, - optimization: { - minimize: false, - }, - target: "node", -};