-
Notifications
You must be signed in to change notification settings - Fork 0
Introduction
Roberto Asiel Guevara Castañeda edited this page Nov 27, 2019
·
12 revisions
The recommended installation method is through npm who pairs nicely with Webpack and Rollup
~$ npm i trebor
TreborJS
have a loader for webpack
that it is integrated with the module, all you need to do is just import the loader from the local installation like this:
// webpack.config.js
{
// other configurations...
resolveLoader: {
alias: {
'trebor-loader': resolve(__dirname, 'node_modules/trebor/loader.js')
}
},
}
Also it have a plugin for rollup
that it is integrated with the module too, all you need to do is just import the plugin from the local installation like this:
// commonjs
const trebor = require('trebor/plugin');
// or
// es2015 and beyond
import trebor from 'trebor/plugin';
Or it can be used as a CLI
to compile stand-alone components
~$ npm i trebor -g
-
comments
: <boolean
> Whether or not put comments in generated code. -
directives
: <object[]
> Array of custome directives to use. -
format
: <string
> A string with'esm'
or'cjs'
. default to'esm'
. -
include
: <string
> Pattern for files to include. Rollup plugin only. -
exclude
: <string
> Pattern for files to exclude. Rollup plugin only.
Type -help
in the console to look the cli options
~$ trebor -help
Now you can go to the next section for learn how to work with this compiler and do awesome things.