Build options
Last updated
Was this helpful?
Last updated
Was this helpful?
Denoify be looking at the root of your project for a denoify.config.js
(or a denoify.config.json
) configuration file.
You can set it up this way:
Following is the type definition of the object expected to be represented in the denoify configuration file:
out
By default Denoify will generate the deno distribution in deno_dist
or deno_lib
depending on whay you have in your tsconfig.json.
If you want for example your dist to be generated in a deno dir instead you would use:
index
includes
Specify what files should be copied over to the deno_dist directory. By default it's the README.md
and the LICENSE
file.
replacer
It let you point to a custom function that will intercept how Denoify replace the imports statement of external module.
Using a replacer is very powerfull but very tricky as well, you should avoid it if you can.
ports
Denoify will replace:
with:
This will work with version of Deno new enough to have NPM support but you probably want to have shipping with a dependency on NPM.
If you know that a port exists on deno.land/x you can specify it:
In this situation the previous import statement will be replaced with:
Now what if there is no existing port?
Don't do that unless you have tried everything else. It's usually much easier to just use a .deno.ts file.
With:
The following import:
Will be transformed into:
(It's defined in the code)
Usually the index of your module is specified in the . If for some reason Denoify doesn't manage to locate this file you can tell explcitely what file should be made the mod.ts
file:
More info .
It's usefull if you know the existence of a port for a specific library. For example Denoify support React out of the box thanks to a .
you have a concrete usage example ins the demo repo.
By default, if you don't specify any ports and, let's say, you have in your dependency pinned at the version 4.1.0
in your package-lock.json
or yarn.lock
.
More info .
Denoify will do it's best to resolve to the version closest to the one that you have pinned. In this case it will fail to find 4.1.0
so it will take the latest that is .
More details .