JavaScript Pack
Transpile JavaScript using Babel.
Internally the JavaScript Pack
uses Babel
to transpile the code if needed.
To configure Babel
settings in your project, a .babelrc.json
file can be used.
Linting code via ESLint
can be utilized by creating an .eslintrc
file.
Setup
npm install --save-dev @packmule/javascript-pack @babel/core eslint
API
JavaScriptPack()
.include(glob: string)
Hints
- cache - Controls cache utilization of the
babel-loader
. - lint - Controls source-code linting via
eslint-loader
. - fix - Controls source-code fixing via
eslint-loader
.
Usage
Example
Process JavaScript code.
import Packmule from '@packmule/core';
import JavascriptPack from '@packmule/javascript-pack';
const packmule = new Packmule();
packmule.register(new JavaScriptPack());
return packmule.generate();
License
MIT