Skip to content

Instantly share code, notes, and snippets.

@adamdbradley
Last active February 14, 2019 05:21
Show Gist options
  • Save adamdbradley/74db2dd9c0fc02e77fb7abea0a704f6f to your computer and use it in GitHub Desktop.
Save adamdbradley/74db2dd9c0fc02e77fb7abea0a704f6f to your computer and use it in GitHub Desktop.
Stencil Compiler
// create the compiler instance
const compiler = new Compiler();
// compiler.fs is the same as node "fs", and always async
await compiler.fs.writeFile('cmp-a.tsx', '....');
// kick off the first build
let results = await compiler.build();
// do an update to the file
await compiler.fs.writeFile('cmp-a.tsx', '....');
// kick off the second build
results = await compiler.build();
{
'cmp-a.tsx': {
jsPath: 'cmp-a.js',
code: '....'
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment