Coder Social home page Coder Social logo

How to use this tool? about packer HOT 4 OPEN

nodegui avatar nodegui commented on August 16, 2024
How to use this tool?

from packer.

Comments (4)

samuelbsource avatar samuelbsource commented on August 16, 2024

I am in the same place as you, no idea how to package my app into .exe file.
Shipping the source code is probably the correct way to ship the app as per QT license but is arguably not user friendly (my audience is people without technical knowledge).
The way I wanted to resolve this is by letting them use .exe and download the source if they have to for whatever reason.

from packer.

imagitama avatar imagitama commented on August 16, 2024

I'm in the same boat. Can't build for Windows at all.

from packer.

amaillo avatar amaillo commented on August 16, 2024

Currently the README page does not mention it, but the "dist" folder content is make with webpack, so you must add it as a dev dependency. Webpack pack index.js in a .node file but some content can't be packed directly so need of plugins to be packed, so those need to be installed too.

The plugins used in the starter repo are ts-loader (for typescript), file-loader (for images) and native-addon-loader (for nodejs), to make them work, you will need a webpack.config.js file that will be in the root folder of your project.

In my particular case the webpack.config.js settings from the starter repo was not useful, i don't use typescript and native-addon+ file-loader were giving me two .node files that weren't working, so i ended up doing a different settings by using native-ext-loader since native-addon was hard to configure alone o_o, anyway, i will leave it here in case someone find it useful.

const path = require("path");


module.exports = {
  mode: process.NODE_ENV || "development",
  entry: "./src",
  target: "node",
  output: {
    path: path.resolve(__dirname, "dist"),
    filename: "index.js"
  },
  module: {
    rules: [
      {
        test: /\.node$/,
        use: [
          {
            loader: "native-ext-loader"
          }
        ]
      }
    ]
  },
};

from packer.

atellmer avatar atellmer commented on August 16, 2024

You should build a dist directory before packing it:

  1. npm run build - build via webpack your app into dist dir with .js and .node files
  2. npx nodegui-packer --init MyApp - creates deploy dir with some meta files.
  3. npx nodegui-packer --pack ./dist - packed app into .exe file if you are using windows platform.
    And your .exe app will be placed in path/to/app/deploy/win32/build

from packer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.