Croffle Bakery
Convert your code to other framework code by Croffle CLI
Install
$ npm install croffle @croffle/bakery
@croffle/bakery
is a Croffle CLI module.
croffle.config.js
Setup - If your file name is in the format
{dir}/{name}{ext}
, then the default dist App path is./{type}/{name}/App{ext}
based on the path your file is in. - Your sub files (components) are
{dir}/{name}{ext}
based on your App path.
If there is no return value of waffle, no file is created.
Multiple outputs are possible with one input.
// @ts-check
import {
ReactCroissant,
VueWaffle,
} from "croffle";
/**
* @type {import("@croffle/bakery").CroffleConfig[]}
*/
const config = [
{
targets: "src/apps/**.tsx",
croissant: ReactCroissant,
waffle: [
VueWaffle,
new VueWaffle(),
() => new VueWaffle({ useVue2: true }),
(defrosted, target) => {
const waffle = new VueWaffle();
return {
dist: `./{type}/{base}/App{ext}`,
waffle,
};
},
],
},
];
module.exports = config;
Run Scripts
$ bake
$ npx @croffle/bakery bake