12.0.0-beta.4 • Published 7 years ago

@njudah/builder v12.0.0-beta.4

Weekly downloads
2
License
MIT
Repository
-
Last release
7 years ago

N Judah Builder

This is a build tool for applying transforms to files.

How Do I use It?

You specify your build using (generic) JSX:

const { build, transform } = require("@njudah/builder");
const babel = require("@njudah/builder/transform/babel");

<build  path = "/path/to/your/project"
        destination = "/path/to/build/folder"
        ignore = "**/node_modules" >
    <transform match = "**/*.js" >
        <babel options = { { presets: ["es2015-node4", "stage-0"] } } />
    </transform>
</build>

Use the promisified interface to run the build and grab the final location:

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"] } } />
        </transform>
    </build>
)
    .then(function (x)
    {
        console.log(x);
    });

If you do not have access to generic JSX, you can use the alternative array syntax:

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);
    });

build attributes

  • path: source path
  • destination: destination folder
  • ignore: files to ignore. Can be glob string, or array of glob strings.

transform attributes

  • match - files to match. Can be glob string, or array of glob strings.

transform child

Transform expects one child, the actual transform function to run. babel is the only currently supported one.

babel attributes

  • options - Babel options.
12.0.0-beta.4

7 years ago

12.0.0-beta.3

7 years ago

12.0.0-beta.2

7 years ago

12.0.0-beta

7 years ago

11.0.0

7 years ago

10.0.0

7 years ago

9.0.0

7 years ago

8.0.0

7 years ago

7.0.0

7 years ago

6.0.0

7 years ago

5.0.0

7 years ago

4.0.0

7 years ago

3.0.0

7 years ago

1.0.0

7 years ago