Build production and development bundle files for foreman core and plugins.
npm install @theforeman/builder> Build production and development bundle files for foreman core and plugins.





- @theforeman/builder/babel - Adds theforeman babel production configuration to your project
- tfm-builder-install - Install the @theforeman/builder to your project.
- tfm-build - Run it to build foreman or a foreman plugin.
- tfm-builder-analyze - Run it to analyze your build content.
- tfm-dev-server - Run a development server so your code will get build and served locally with a live-reload feature.
``sh`
npm install --save-dev @theforeman/builder
`sh`
tfm-builder-installanswer the questions
1. Create a .babelrc.js file in your project root with the following content.
`js
module.exports = {
presets: ['@theforeman/builder/babel'],
};
`
> @theforeman/builder/babel will automatically load @theforeman/env/babel for none production environments.
2. Create a config/tfm-builder.config.js file with the following content:
`js
module.exports = {
// set your javascript entry points
entry: {
'my-plugin': 'webpack/assets/myPlugin.js',
'my-plugin-fills': 'webpack/assets/myPluginFills.js',
},
// set your output path
outputPath: 'public/webpack',
// if using in foreman core (won't work for plugins)
// set a devServer
devServer: {
port: '3808',
host: process.env.BIND || 'localhost',
}
};
`
3. Add build scripts to your package.json`json`
{
"scripts": {
"build": "tfm-build config/tfm-builder.config.js",
"build-analyze": "tfm-builder-analyze config/tfm-builder.config.js",
"dev-server": "tfm-dev-server config/tfm-builder.config.js"
}
}
Please checkout the contributing.md, the roadmap.md` and the open issues.