bundle your files.
use npm or yarn package manager to install byf.
# Using npm
$ npm install -g @FlamesX-128/byf
# Using yarn
$ yarn global add @FlamesX-128/byf
In order to use the package, use the 'bys' command.
$ byf
Byf should have a config file called 'byf.config.js' with the following:
interface Config {
/** @type {string} - The main file. */
entry: string,
/**
* If you want it to be imported in a different way.
* - Must have a minimum and maximum of 2 containers.
* - Basic structure: '/()('(.*)')/'
*
* @type {string} - The main file.
* @default /()('(.*)')/
*/
importer?: RegExp,
/** File creation options. */
output?: {
/**
* @type {string | undefined} - File name.
* @default 'bundle'
*/
filename?: string,
/**
* Path where the file will be created.
* This includes the console path.
*
* @type {string | undefined}
* @default console.cwd()
*/
path?: string
},
/** Plugin options. */
plugins?: {
/**
* Here you add the extensions that must go through this plugin.
* @type {RegExp | undefined}
*/
extention?: RegExp,
/**
* The plugin handler module or function.
* @type {(string | ((doc: string) => string))[]}
*/
use?: (string | ((doc: string) => string))[]
}[]
}
// byf.config.js
module.exports = {
entry: 'main.js',
output: {
filename: 'bundle.js'
}
}
// index.js
import('hello.js')
// hello.js
(function () {
console.log('Hello world')
})()
// Output: bundle.js
(function () {
console.log('Hello world')
})()
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.