npm i @muntrue/generateimports
Package to generate import files with easy, currently supports:
- Javascript ECMAScript 6 classes
- File separated Vue components
- Sass files
Package will scan folders for filetypes and add them to a predefined output file.
Module will accept an object with three properties
{
files: [], // Array with single files to include in the import list
folders: [], // Array with folders to scan trough, this scan is recursive.
output: "" // String with the filename where the output file will be stored.
}
const generator = require("@muntrue/generateimports");
generator.js({
files: ["vendor.js"],
folders: ["resources/js", "additional/folders"],
output: "importsfile.js"
});
const generator = require("@muntrue/generateimports");
generator.vue({
folders: ["resources/vue-components", "additional/folders"],
output: "vue-importsfile.js"
});
const generator = require("@muntrue/generateimports");
generator.scss({
folders: ["resources/scss", "vendor/scss", "additional/folders"],
output: "vue-importsfile.js"
});