Build tool
npm install @njudah/builderThis is a build tool for applying transforms to files.
You specify your build using (generic) JSX:
``JavaScript
const { build, transform } = require("@njudah/builder");
const babel = require("@njudah/builder/transform/babel");
ignore = "**/node_modules" >
`
Use the promisified interface to run the build and grab the final location:
`JavaScript
require("@njudah/builder/promisifed")(
ignore = "**/node_modules" >
)
.then(function (x)
{
console.log(x);
});
`
If you do not have access to generic JSX, you can use the alternative array syntax:
`JavaScript
require("@njudah/builder/promisifed")(
[build,
{
path: "/path/to/your/project",
destination: "/path/to/build/folder"
ignore: "**/node_modules"
},
[transform, { match: "*/.js" },
[babel, { options: { presets: ["es2015-node4", "stage-0"] } }
]
]
)
.then(function (x)
{
console.log(x);
});
``
- path: source path
- destination: destination folder
- ignore: files to ignore. Can be glob string, or array of glob strings.
- match - files to match. Can be glob string, or array of glob strings.
Transform expects one child, the actual transform function to run. babel is the only currently supported one.
- options - Babel options.