English 中文(简体)
Node js - How to establish an excutable with pkg
原标题:Node js - How to create an executable with pkg

I m试图在我的噪音项目(pkg)中建立<编码>可执行,而且我可以创建,但没有文件。

因此,我安装了pkg with npmstal-g pkg ,载于 Package.json。 我补充说:

"pkg": {
    "scripts": "public/js/*.js",
    "assets": "public/css/*.css",
    "assets": "views/**/*"
  },

除卷宗外,它还对 j子进行罚款,并承认意见。

我的项目结构是:

  • public
    • css
      • app.css
    • js
      • app.js
    • images
  • views

在奥索尔,我指挥<编码>pkg .,并产生支气、aco子和双赢。

我怎么能够补充我的剪辑和图像夹?

问题回答

一揽子计划。 json 案卷,同前。

 "pkg": {    
     "assets": [
         "views/*",
         "Public/**/*"    
      ],
  ...
  }

将你们的所有形象、 j、 c等带入公共链条

一种解决办法是将pkg检测源代码中的资产,而不是在 Package.json水平上使用一个混合物。

文件here。 基本而言,如果您在来源代码上添加以下条目:path.join(_dirname, /path/to/asset.cs ); 。 这应当自动添加到可执行之列。





相关问题
How to make Sequelize use singular table names

I have an model called User but Sequelize looks for the table USERS whenever I am trying to save in the DB. Does anyone know how to set Sequelize to use singular table names? Thanks.

What is Node.js? [closed]

I don t fully get what Node.js is all about. Maybe it s because I am mainly a web based business application developer. What is it and what is the use of it? My understanding so far is that: The ...

Clientside going serverside with node.js

I`ve been looking for a serverside language for some time, and python got my attention somewhat. But as I already know and love javascript, I now want learn to code on the server with js and node.js. ...

Can I use jQuery with Node.js?

Is it possible to use jQuery selectors/DOM manipulation on the server-side using Node.js?

How do I escape a string for a shell command in node?

In nodejs, the only way to execute external commands is via sys.exec(cmd). I d like to call an external command and give it data via stdin. In nodejs there does yet not appear to be a way to open a ...

热门标签