MohamedLamineAllal / laravel-mix-glob

Laravel mix extension that add glob support.
MIT License
20 stars 6 forks source link

Vue - defaultMapExt: no mapping precised, neither it's supported by default #61

Closed reageek closed 1 year ago

reageek commented 2 years ago

Hello and thanks for this amazing plugin. I have used it on other projects but never before with vue.

I am trying to get this plugin to work with an existing vue app. I experience the error defaultMapExt: no mapping precised, neither it's supported by default when building my js/vue components which is very vague and I have not been able to find a solution.

I have looked through https://github.com/MohamedLamineAllal/laravel-mix-glob/issues/52 and reread the documentation and have stuck the mapping everywhere that I can think of that might make sense... does this plugin support .vue()?

I have the appropriate vue-loader and vue-template-compiler installed. When I compile without the .vue() command I get the expected You may need an appropriate loader to handle this file type. I can successfully compile these using the normal mix.js() with the sources as a stack, and call the .vue() command at the end and it works but it is a lot of files. Hence why I would like to use this plugin.

Some assistance or guidance on what I am doing wrong would be appreciated.

My webpack.mix.js contents

const mix = require("laravel-mix"),
    MixGlob = require("laravel-mix-glob"),
    srcPath = "resources",
    distPath = "public",
    mixGlob = new MixGlob({
        mix,
        mapping: {
            js: {
                ext: "js",
            },
            vue: {
                ext: "js",
            },
            sass: {
                ext: "css",
            },
            css: {
                ext: "css",
            },
            postCss: {
                ext: "css",
            },
        },
    });

mix.autoprefixer = [
    "Android 2.3",
    "Android >= 4",
    "Chrome >= 20",
    "Firefox >= 24",
    "Explorer >= 10",
    "iOS >= 6",
    "Opera >= 12",
    "Safari >= 6",
];

mix.setPublicPath(distPath)
    .options({
        processCssUrls: false,
        preset: "vanilla",
        browsers: ["last 20 versions", "ie 10-11"],
        grid: true,
        imgLoaderOptions: {
            enabled: false,
        },
    })
    .sourceMaps();

//Works just fine
mixGlob.sass([srcPath + "/sass/*.scss"], "public/css", null, {
    base: srcPath + "/sass/",
    precision: 8,
});
//
mixGlob
    .js([srcPath + "/js/**/*.{js,vue}"], "public/js", null, {
        base: srcPath + "/js/",
        mapping: {
            js: {
                ext: "js",
            },
            vue: {
                ext: "js",
            },
        },
    })
    .vue();

//JS Eloquent Classes
mix.babel([srcPath + "/js/classes/*.js"], "public/js/EloquentClasses.js");
//Copy assets
mix.copy(srcPath + "/json", "public/json")
    .copy(srcPath + "/fonts", "public/fonts")
    .copy(srcPath + "/images", "public/images")
    .copy(srcPath + "/plugins", "public/plugins")
    .copy(
        "node_modules/@fortawesome/fontawesome-free/webfonts",
        "public/webfonts"
    )
    .copy(
        "node_modules/bootstrap-sass/assets/fonts/bootstrap",
        "public/fonts/bootstrap"
    );

if (mix.inProduction()) {
    mix.version();
}

Package.json

{
   ...
    "devDependencies": {
        "@vue/compiler-sfc": "^3.2.33",
        "autoprefixer": "^10.4.7",
        "axios": "^0.27.2",
        "cross-env": "^5.1",
        "jquery": "^3.3.1",
        "laravel-mix": "^6.0.43",
        "laravel-mix-glob": "^1.1.10",
        "less": "^3.9.0",
        "lodash": "^4.17.5",
        "postcss-cssnext": "^3.1.1",
        "postcss-import": "^14.1.0",
        "resolve-url-loader": "^2.3.1",
        "sass": "^1.22.3",
        "sass-loader": "^12.6.0",
        "vue": "^3.2.33",
        "vue-loader": "^17.0.0"
    },
    "dependencies": {
        "@fancyapps/fancybox": "^3.5.7",
        "@fortawesome/fontawesome-free": "^6.1.1",
        "awesome-notifications": "^2.2.9",
        "bootstrap": "^4.3.1",
        "bootstrap-sass": "^3.4.1",
        "bootstrap-select": "1.13.5",
        "bootstrap-switch": "^3.3.4",
        "busy-load": "^0.1.2",
        "datatables.net": "^1.10.19",
        "datatables.net-bs": "^1.10.19",
        "datatables.net-buttons-bs": "^1.5.4",
        "datatables.net-colreorder-bs": "^1.5.1",
        "datatables.net-dt": "^1.10.19",
        "datatables.net-fixedheader-bs": "^3.1.5",
        "datatables.net-keytable-bs": "^2.5.0",
        "datatables.net-responsive-bs": "^2.2.3",
        "datatables.net-responsive-dt": "^2.2.3",
        "datatables.net-rowgroup-bs": "^1.1.0",
        "datatables.net-rowreorder-bs": "^1.2.5",
        "datatables.net-scroller-bs": "^1.5.1",
        "datatables.net-select-bs": "^1.2.7",
        "daterangepicker": "^3.0.3",
        "jquery-ui": "^1.12.1",
        "jquery-ui-dist": "^1.12.1",
        "jquery-validation": "^1.19.0",
        "jquery.uniform": "^4.3.0",
        "material-design-icons": "^3.0.1",
        "moment": "^2.24.0",
        "popper.js": "^1.15.0",
        "sanitize-html": "^1.20.1",
        "select2": "^4.0.13",
        "switchery": "0.0.2",
        "toastr": "^2.1.4",
        "typeahead": "^0.2.2",
        "uniform": "^0.5.1",
        "velocity-animate": "^1.5.2"
    }
 }

Compiler output

npx mix             541ms  Fri 06 May 2022 04:25:12 PM
  MixGlob Mix glob +0ms
  MixGlob mix function: sass +1ms
  MixGlob Glob: resources/sass/*.scss +0ms
  MixGlob Matched files ==== +5ms
  MixGlob [
  MixGlob   'resources/sass/app.scss',
  MixGlob   'resources/sass/dashboard.scss',
  MixGlob   'resources/sass/landing.scss',
  MixGlob   'resources/sass/login.scss',
  MixGlob   'resources/sass/opportunities.scss',
  MixGlob   'resources/sass/print.scss',
  MixGlob   'resources/sass/profiles.scss',
  MixGlob   'resources/sass/settings.scss'
  MixGlob ] +0ms
  MixGlob { file: 'app.css', out: 'public/css/app.css' } +1ms
  MixGlob { file: 'dashboard.css', out: 'public/css/dashboard.css' } +1ms
  MixGlob { file: 'landing.css', out: 'public/css/landing.css' } +0ms
  MixGlob { file: 'login.css', out: 'public/css/login.css' } +0ms
  MixGlob { file: 'opportunities.css', out: 'public/css/opportunities.css' } +0ms
  MixGlob { file: 'print.css', out: 'public/css/print.css' } +0ms
  MixGlob { file: 'profiles.css', out: 'public/css/profiles.css' } +0ms
  MixGlob { file: 'settings.css', out: 'public/css/settings.css' } +0ms
  MixGlob mix function: js +1ms
  MixGlob Glob: resources/js/**/*.{js,vue} +0ms
  MixGlob Matched files ==== +4ms
  MixGlob [
  MixGlob   'resources/js/Ajax.js',
  MixGlob   'resources/js/CoreDataTablesFilter.js',
  MixGlob   'resources/js/NotifierServerSide.js',
  MixGlob   'resources/js/app.js',
  MixGlob   'resources/js/app2.js',
  MixGlob   'resources/js/blockui.min.js',
  MixGlob   'resources/js/bootstrap.js',
  MixGlob   'resources/js/langUI-root.js',
  MixGlob   'resources/js/prism.min.js',
  MixGlob   'resources/js/progressbar.min.js',
  MixGlob   'resources/js/vue-for-jobs.js',
  MixGlob   'resources/js/vue-for-resource.js',
  MixGlob   'resources/js/vue-for-resources.js',
  MixGlob   'resources/js/vue-for-resumes.js',
  MixGlob   'resources/js/vue-for-training.js',
  MixGlob   'resources/js/vue-for-trainings.js',
  MixGlob   'resources/js/classes/AOI_Resume.js',
  MixGlob   'resources/js/classes/Award.js',
  MixGlob   'resources/js/classes/Education.js',
  MixGlob   'resources/js/classes/Employment.js',
  MixGlob   'resources/js/classes/Resume.js',
  MixGlob   'resources/js/classes/Skill.js',
  MixGlob   'resources/js/components/ApplyForJobModal.vue',
  MixGlob   'resources/js/components/BootstrapSelect.vue',
  MixGlob   'resources/js/components/DateRangePicker.vue',
  MixGlob   'resources/js/components/JobDetails.vue',
  MixGlob   'resources/js/components/JobGridListItem.vue',
  MixGlob   'resources/js/components/Modal_AddNewResume.vue',
  MixGlob   'resources/js/components/Modal_AddNewSkill.vue',
  MixGlob   'resources/js/components/Modal_ResumeAward.vue',
  MixGlob   'resources/js/components/Modal_ResumeCoverLetter.vue',
  MixGlob   'resources/js/components/Modal_ResumeEducation.vue',
  MixGlob   'resources/js/components/Modal_ResumeEmployment.vue',
  MixGlob   'resources/js/components/Modal_ResumeOverview.vue',
  MixGlob   'resources/js/components/PublicJobPostingsList.vue',
  MixGlob   'resources/js/components/Resume.vue',
  MixGlob   'resources/js/components/ResumeItemAward.vue',
  MixGlob   'resources/js/components/ResumeItemEducation.vue',
  MixGlob   'resources/js/components/ResumeItemEmployment.vue',
  MixGlob   'resources/js/components/ResumeSectionAwards.vue',
  MixGlob   'resources/js/components/ResumeSectionEducation.vue',
  MixGlob   'resources/js/components/ResumeSectionEmployment.vue',
  MixGlob   'resources/js/components/ResumeSectionInterests.vue',
  MixGlob   'resources/js/components/ResumeSectionOverview.vue',
  MixGlob   'resources/js/components/ResumeSectionSkills.vue',
  MixGlob   'resources/js/components/ResumeSectionTitle.vue',
  MixGlob   'resources/js/components/SidePanelComponent.vue',
  MixGlob   'resources/js/components/SidePanelItem.vue',
  MixGlob   'resources/js/components/SidePanelList.vue',
  MixGlob   'resources/js/mixins/EloquentMirrorVue.js',
  MixGlob   'resources/js/mixins/InfiniteScrollingList.js',
  MixGlob   'resources/js/mixins/JobSeekerSidebar.js',
  MixGlob   'resources/js/pages/add-company.js',
  MixGlob   'resources/js/pages/add-opportunity.js',
  MixGlob   'resources/js/pages/add-resource.js',
  MixGlob   'resources/js/pages/add-training.js',
  MixGlob   'resources/js/pages/add-user.js',
  MixGlob   'resources/js/pages/admin-dashboard.js',
  MixGlob   'resources/js/pages/admin-opportunities.js',
  MixGlob   'resources/js/pages/applicants-list.js',
  MixGlob   'resources/js/pages/employer-opportunities.js',
  MixGlob   'resources/js/pages/employer-profile.js',
  MixGlob   'resources/js/pages/experiences-dashboard.js',
  MixGlob   'resources/js/pages/job-opportunities.js',
  MixGlob   'resources/js/pages/language_picker.js',
  MixGlob   'resources/js/pages/login.js',
  MixGlob   'resources/js/pages/manage-companies.js',
  MixGlob   'resources/js/pages/manage-localizations.js',
  MixGlob   'resources/js/pages/manage-resources.js',
  MixGlob   'resources/js/pages/manage-training.js',
  MixGlob   'resources/js/pages/profile.js',
  MixGlob   'resources/js/pages/register.js',
  MixGlob   'resources/js/pages/resume.js',
  MixGlob   'resources/js/pages/settings.js',
  MixGlob   'resources/js/pages/users-list.js',
  MixGlob   'resources/js/pages/value-list-standard.js',
  MixGlob   'resources/js/components/Localization/Localization.vue',
  MixGlob   'resources/js/components/Localization/LocalizationRow.vue',
  MixGlob   'resources/js/components/Resources/ResourceDetails.vue',
  MixGlob   'resources/js/components/Resources/Resources.vue',
  MixGlob   'resources/js/components/Resources/ResourcesItem.vue',
  MixGlob   'resources/js/components/Training/TrainingDetails.vue',
  MixGlob   'resources/js/components/Training/Trainings.vue',
  MixGlob   'resources/js/components/Training/TrainingsItem.vue',
  MixGlob   'resources/js/upload/fileinput/fileinput.min.js',
  MixGlob   'resources/js/upload/fileinput/plugins/piexif.min.js',
  MixGlob   'resources/js/upload/fileinput/plugins/purify.min.js',
  MixGlob   'resources/js/upload/fileinput/plugins/sortable.min.js'
  MixGlob ] +0ms
  MixGlob { file: 'Ajax.js', out: 'public/js/Ajax.js' } +1ms
  MixGlob {
  MixGlob   file: 'CoreDataTablesFilter.js',
  MixGlob   out: 'public/js/CoreDataTablesFilter.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'NotifierServerSide.js',
  MixGlob   out: 'public/js/NotifierServerSide.js'
  MixGlob } +0ms
  MixGlob { file: 'app.js', out: 'public/js/app.js' } +0ms
  MixGlob { file: 'app2.js', out: 'public/js/app2.js' } +0ms
  MixGlob { file: 'blockui.min.js', out: 'public/js/blockui.min.js' } +1ms
  MixGlob { file: 'bootstrap.js', out: 'public/js/bootstrap.js' } +0ms
  MixGlob { file: 'langUI-root.js', out: 'public/js/langUI-root.js' } +0ms
  MixGlob { file: 'prism.min.js', out: 'public/js/prism.min.js' } +0ms
  MixGlob { file: 'progressbar.min.js', out: 'public/js/progressbar.min.js' } +0ms
  MixGlob { file: 'vue-for-jobs.js', out: 'public/js/vue-for-jobs.js' } +0ms
  MixGlob { file: 'vue-for-resource.js', out: 'public/js/vue-for-resource.js' } +0ms
  MixGlob { file: 'vue-for-resources.js', out: 'public/js/vue-for-resources.js' } +0ms
  MixGlob { file: 'vue-for-resumes.js', out: 'public/js/vue-for-resumes.js' } +0ms
  MixGlob { file: 'vue-for-training.js', out: 'public/js/vue-for-training.js' } +0ms
  MixGlob { file: 'vue-for-trainings.js', out: 'public/js/vue-for-trainings.js' } +0ms
  MixGlob {
  MixGlob   file: 'classes/AOI_Resume.js',
  MixGlob   out: 'public/js/classes/AOI_Resume.js'
  MixGlob } +0ms
  MixGlob { file: 'classes/Award.js', out: 'public/js/classes/Award.js' } +1ms
  MixGlob { file: 'classes/Education.js', out: 'public/js/classes/Education.js' } +0ms
  MixGlob {
  MixGlob   file: 'classes/Employment.js',
  MixGlob   out: 'public/js/classes/Employment.js'
  MixGlob } +0ms
  MixGlob { file: 'classes/Resume.js', out: 'public/js/classes/Resume.js' } +0ms
  MixGlob { file: 'classes/Skill.js', out: 'public/js/classes/Skill.js' } +0ms
  MixGlob {
  MixGlob   file: 'components/ApplyForJobModal.js',
  MixGlob   out: 'public/js/components/ApplyForJobModal.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'components/BootstrapSelect.js',
  MixGlob   out: 'public/js/components/BootstrapSelect.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'components/DateRangePicker.js',
  MixGlob   out: 'public/js/components/DateRangePicker.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'components/JobDetails.js',
  MixGlob   out: 'public/js/components/JobDetails.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'components/JobGridListItem.js',
  MixGlob   out: 'public/js/components/JobGridListItem.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'components/Modal_AddNewResume.js',
  MixGlob   out: 'public/js/components/Modal_AddNewResume.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'components/Modal_AddNewSkill.js',
  MixGlob   out: 'public/js/components/Modal_AddNewSkill.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'components/Modal_ResumeAward.js',
  MixGlob   out: 'public/js/components/Modal_ResumeAward.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'components/Modal_ResumeCoverLetter.js',
  MixGlob   out: 'public/js/components/Modal_ResumeCoverLetter.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'components/Modal_ResumeEducation.js',
  MixGlob   out: 'public/js/components/Modal_ResumeEducation.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'components/Modal_ResumeEmployment.js',
  MixGlob   out: 'public/js/components/Modal_ResumeEmployment.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'components/Modal_ResumeOverview.js',
  MixGlob   out: 'public/js/components/Modal_ResumeOverview.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'components/PublicJobPostingsList.js',
  MixGlob   out: 'public/js/components/PublicJobPostingsList.js'
  MixGlob } +0ms
  MixGlob { file: 'components/Resume.js', out: 'public/js/components/Resume.js' } +1ms
  MixGlob {
  MixGlob   file: 'components/ResumeItemAward.js',
  MixGlob   out: 'public/js/components/ResumeItemAward.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'components/ResumeItemEducation.js',
  MixGlob   out: 'public/js/components/ResumeItemEducation.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'components/ResumeItemEmployment.js',
  MixGlob   out: 'public/js/components/ResumeItemEmployment.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'components/ResumeSectionAwards.js',
  MixGlob   out: 'public/js/components/ResumeSectionAwards.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'components/ResumeSectionEducation.js',
  MixGlob   out: 'public/js/components/ResumeSectionEducation.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'components/ResumeSectionEmployment.js',
  MixGlob   out: 'public/js/components/ResumeSectionEmployment.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'components/ResumeSectionInterests.js',
  MixGlob   out: 'public/js/components/ResumeSectionInterests.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'components/ResumeSectionOverview.js',
  MixGlob   out: 'public/js/components/ResumeSectionOverview.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'components/ResumeSectionSkills.js',
  MixGlob   out: 'public/js/components/ResumeSectionSkills.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'components/ResumeSectionTitle.js',
  MixGlob   out: 'public/js/components/ResumeSectionTitle.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'components/SidePanelComponent.js',
  MixGlob   out: 'public/js/components/SidePanelComponent.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'components/SidePanelItem.js',
  MixGlob   out: 'public/js/components/SidePanelItem.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'components/SidePanelList.js',
  MixGlob   out: 'public/js/components/SidePanelList.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'mixins/EloquentMirrorVue.js',
  MixGlob   out: 'public/js/mixins/EloquentMirrorVue.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'mixins/InfiniteScrollingList.js',
  MixGlob   out: 'public/js/mixins/InfiniteScrollingList.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'mixins/JobSeekerSidebar.js',
  MixGlob   out: 'public/js/mixins/JobSeekerSidebar.js'
  MixGlob } +0ms
  MixGlob { file: 'pages/add-company.js', out: 'public/js/pages/add-company.js' } +0ms
  MixGlob {
  MixGlob   file: 'pages/add-opportunity.js',
  MixGlob   out: 'public/js/pages/add-opportunity.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'pages/add-resource.js',
  MixGlob   out: 'public/js/pages/add-resource.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'pages/add-training.js',
  MixGlob   out: 'public/js/pages/add-training.js'
  MixGlob } +0ms
  MixGlob { file: 'pages/add-user.js', out: 'public/js/pages/add-user.js' } +0ms
  MixGlob {
  MixGlob   file: 'pages/admin-dashboard.js',
  MixGlob   out: 'public/js/pages/admin-dashboard.js'
  MixGlob } +1ms
  MixGlob {
  MixGlob   file: 'pages/admin-opportunities.js',
  MixGlob   out: 'public/js/pages/admin-opportunities.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'pages/applicants-list.js',
  MixGlob   out: 'public/js/pages/applicants-list.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'pages/employer-opportunities.js',
  MixGlob   out: 'public/js/pages/employer-opportunities.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'pages/employer-profile.js',
  MixGlob   out: 'public/js/pages/employer-profile.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'pages/experiences-dashboard.js',
  MixGlob   out: 'public/js/pages/experiences-dashboard.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'pages/job-opportunities.js',
  MixGlob   out: 'public/js/pages/job-opportunities.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'pages/language_picker.js',
  MixGlob   out: 'public/js/pages/language_picker.js'
  MixGlob } +0ms
  MixGlob { file: 'pages/login.js', out: 'public/js/pages/login.js' } +0ms
  MixGlob {
  MixGlob   file: 'pages/manage-companies.js',
  MixGlob   out: 'public/js/pages/manage-companies.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'pages/manage-localizations.js',
  MixGlob   out: 'public/js/pages/manage-localizations.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'pages/manage-resources.js',
  MixGlob   out: 'public/js/pages/manage-resources.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'pages/manage-training.js',
  MixGlob   out: 'public/js/pages/manage-training.js'
  MixGlob } +1ms
  MixGlob { file: 'pages/profile.js', out: 'public/js/pages/profile.js' } +0ms
  MixGlob { file: 'pages/register.js', out: 'public/js/pages/register.js' } +0ms
  MixGlob { file: 'pages/resume.js', out: 'public/js/pages/resume.js' } +0ms
  MixGlob { file: 'pages/settings.js', out: 'public/js/pages/settings.js' } +0ms
  MixGlob { file: 'pages/users-list.js', out: 'public/js/pages/users-list.js' } +0ms
  MixGlob {
  MixGlob   file: 'pages/value-list-standard.js',
  MixGlob   out: 'public/js/pages/value-list-standard.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'components/Localization/Localization.js',
  MixGlob   out: 'public/js/components/Localization/Localization.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'components/Localization/LocalizationRow.js',
  MixGlob   out: 'public/js/components/Localization/LocalizationRow.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'components/Resources/ResourceDetails.js',
  MixGlob   out: 'public/js/components/Resources/ResourceDetails.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'components/Resources/Resources.js',
  MixGlob   out: 'public/js/components/Resources/Resources.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'components/Resources/ResourcesItem.js',
  MixGlob   out: 'public/js/components/Resources/ResourcesItem.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'components/Training/TrainingDetails.js',
  MixGlob   out: 'public/js/components/Training/TrainingDetails.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'components/Training/Trainings.js',
  MixGlob   out: 'public/js/components/Training/Trainings.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'components/Training/TrainingsItem.js',
  MixGlob   out: 'public/js/components/Training/TrainingsItem.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'upload/fileinput/fileinput.min.js',
  MixGlob   out: 'public/js/upload/fileinput/fileinput.min.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'upload/fileinput/plugins/piexif.min.js',
  MixGlob   out: 'public/js/upload/fileinput/plugins/piexif.min.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'upload/fileinput/plugins/purify.min.js',
  MixGlob   out: 'public/js/upload/fileinput/plugins/purify.min.js'
  MixGlob } +0ms
  MixGlob {
  MixGlob   file: 'upload/fileinput/plugins/sortable.min.js',
  MixGlob   out: 'public/js/upload/fileinput/plugins/sortable.min.js'
  MixGlob } +0ms
[webpack-cli] defaultMapExt: no mapping precised, neither it's supported by default
MohamedLamineAllal commented 2 years ago

Hi, @reageek I'm too late, sorry for that. I wasn't checking the package. And I was struggling with time. I'm counting to bring new stuff. Starting by re-organizing the documentation.

Glade to hear that the plugin was very helpful.

For the .vue() issue. The way .vue(), .react(), .extract() and all function that doesn't have src arg. And that their call is unrelated of the function before it. Which is the case for all functions, or at least the one I mentioned. The way to use them is as follow: mix.js().mix('vue')(). The mix() function will return the laravel-mix Mix instance. And through it the .vue() would be correct.

Now after looking at it. Besides redoing the documentation. I will add the support to those functions so no need to use .mix('vue')() for such kind of function. And if in any new version of laravel-mix some new function gets added. I will add a configuration option to be able to add it. And also you can open a PR. And u can use the old .mix() method.

I'm thinking of adding a new property mapper. When used. A glob goes first. The functions that don't have src. And an exec() at the end. That will allow in case needed in any case. Which may never be. To be able to use a glob. And have for every file targeted by the glob to have the chain applied to it as well.

mixGlob.mapper.js('some/globe/*.compile.js', 'dist/').options().exec()

options() is a function that is expected to run globally. i have no idea what function work following what before it. I'll be checking the functions. I checked some already. But the command above would run the chain bellow:

mix.js('file1.js', 'dist/').options()
mix.js('file2.js', 'dist/').options()
mix.js('file3.js', 'dist/').options()

While running mixGlob.js('some/globe/*.compile.js', 'dist/').options() after the update would result in:

mix.js('file1.js', 'dist/')
mix.js('file2.js', 'dist/')
mix.js('file3.js', 'dist/')
mix.options()

For options, the second and natural way is to be used. Because it is needed to be called only once.

However by having those implementations. I guess any need will be covered. And the API would be both intuitive for including those no src functions that I didn't and let to be used with mix(). And if needed. The plugin will be able to run functions against globs.

Any suggestions are welcomed.

I'll work on it this week. I'll handle this the ideal way. And I'll do a re-analysis. Will update u as soon as it's done.

MohamedLamineAllal commented 2 years ago

I'm mostly about to finish version 2 of the package. A totally new approach and full re-implementation. that is way more flexible powerful and simple or intuitive. And extensive typescript typing as well. I didn't go for any of the mentions above. For backward compatibility. I'm providing a classic version of the extension. That will keep the same way of usage as the old one. Only for the purpose of having a one-liner change to keep the old code working.

MohamedLamineAllal commented 1 year ago

@reageek you should check the v2 it's finally out.