@bavary/webpack-loader
v1.0.1
Published
Webpack Loader for bavary declaration files
Downloads
5
Maintainers
Readme
Checkout related packages
Install via npm:
$ npm install -g @bavary/webpack-loader
Install via yarn:
$ yarn global add @bavary/webpack-loader
Usage
Create a new rule with @bavary/webpack-loader
as loader:
module.exports = {
// ...
module: {
rules: [
{
test: /\.bv$/,
use: '@bavary/webpack-loader'
}
]
}
// ...
};
Be sure to install the peer-dependency @bavary/core and optionally @bavary/bavary-lib if you want make use of the functions option.
Available options
const options = {
// Module type
esModule: false,
// Inject functions from @bavary/lib. Be sure to install @bavary/lib to use them
functions: ['count', ...],
...bavaryOptions
}
where bavaryOptions
are all options which can be used in the compiler configuration.
Example
./index.bv
entry ['A' | 'B']
./app.js
import parse from './index.bv';
console.log(parse('A')); // Logs "A"
Related packages
- @bavary/core - Parser and compiler.
- @bavary/cli - CLI with development server.
- @bavary/bavary-lib - Standard library with extensions for bavary.
- @bavary/webpack-loader - Webpack loader for declaration files.