mohamedlamineallal / laravel-mix-glob Goto Github PK
View Code? Open in Web Editor NEWLaravel mix extension that add glob support.
License: MIT License
Laravel mix extension that add glob support.
License: MIT License
Having an issue running 'mix watch' while using mixglob... Getting the following error:
Error: read ENOTCONN
at tryReadStart (net.js:575:20)
at WriteStream.Socket.read (net.js:586:5)
at WriteStream.Readable.read (internal/streams/readable.js:462:10)
at WriteStream.Socket.read (net.js:627:39)
at resume (internal/streams/readable.js:958:12)
at processTicksAndRejections (internal/process/task_queues.js:82:21)
Emitted 'error' event on WriteStream instance at:
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:82:21) {
errno: -4053,
code: 'ENOTCONN',
syscall: 'read'
}
It almost seems like it's trying to call watch twice, and the files are still locked from the previous run.
Any ideas?
When globbing through an empty source folder, an error is output which stops other tasks to run if no files are found.
No response
Globbing should ignore empty folders gracefully.
Error output:
[webpack-cli] Error: No matched files for the Glob of arg of index 0
let mix = require('laravel-mix');
const { glb } = require('laravel-mix-glob');
const themePath = 'docroot/themes/custom/mytheme';
mix.sass(
glb.src(
[`./stories/01-atoms/**/*.scss`,
`./stories/02-molecules/**/*.scss`,
`./stories/03-organisms/**/*.scss`,
`./stories/04-atoms/**/*.scss`,
`./stories/04-templates/**/*.scss`]),
glb.out({
baseMap: `./stories`,
outMap: `${themePath}/stories`,
}),
);
mix.sass(`./stories/00-base/rfs.scss`, `${themePath}/css`);
mix.js(
glb.src(
[
`./stories/01-atoms/**/*.js`,
`./stories/02-molecules/**/*.js`,
`./stories/03-organisms/**/*.js`,
`./stories/04-templates/**/*.js`
]),
glb.out({
baseMap: `./stories`,
outMap: `${themePath}/stories`,
}),
);
mix.minify(`${themePath}/js/script.js`);
mix.copy(
glb.src(`./stories/**/*.twig`),
glb.out({
baseMap: `./stories`,
outMap: `${themePath}/stories`,
}),
);
laravel-mix: 6.0.49,
laravel-mix-glob: 2.0.1,
webpack: 5.76.3
No response
Is this package compatible with Laravel 8?
Why is such a beautiful package not popular enough? Should i trust? Because I don't have much time to try.
Is there an option to do this? Cheers!
did exactly as told, using latest laravel-mix
TypeError: Cannot read property 'ts' of undefined
Hello, thank you for this cool plugin. Is it possible to enable the import of all files inside a folder?
For example to import all scss files into one main file?
main.scss
@import "components/**/*";
Hi!
(I found #5, but I want to open a new issue with more specific title + description.)
laravel-mix-glob makes noise in the debug output, if none of the process.env.DEBUG*
keys are present.
The problem can be reduced to the following webpack.min.js:
const MixGlob = require('laravel-mix-glob');
-> "!!!!! ----- No debug env var ----- !!!!"
process.env.DEBUG = false;
const MixGlob = require('laravel-mix-glob');
-> no warnings
The code in noDebugEnvVar()
suggests that we need at least one of the following keys in process.env
:
The variables are explained on https://github.com/visionmedia/debug, and the same variables are also used in DEBUG_ENV_VARS in laravelMixGlob.min.js.
Name | Purpose |
---|---|
DEBUG |
Enables/disables specific debugging namespaces. |
DEBUG_HIDE_DATE |
Hide date from debug output (non-TTY). |
DEBUG_COLORS |
Whether or not to use colors in the debug output. |
DEBUG_DEPTH |
Object inspection depth. |
DEBUG_SHOW_HIDDEN |
Shows hidden properties on inspected objects. |
This leads me to the following questions:
process.env.DEBUG*
?When i run npm run watch
i get this error:
webpack is watching the files…
events.js:180
throw er; // Unhandled 'error' event
^
Error: read ENOTCONN
at WriteStream.Socket._read (net.js:530:20)
at WriteStream.Readable.read (_stream_readable.js:474:10)
at resume_ (_stream_readable.js:953:12)
at processTicksAndRejections (internal/process/task_queues.js:77:11)
Emitted 'error' event at:
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
at processTicksAndRejections (internal/process/task_queues.js:77:11) {
errno: 'ENOTCONN',
code: 'ENOTCONN',
syscall: 'read'
}
But running the npm run dev, is totally fine!!
OS: Windows
NPM: 6.5.0
NODE: v12.7.0
Version of package installed:
"laravel-mix": "^4.0.16",
"laravel-mix-glob": "^1.1.2",
I think it's related to issue #2
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\user\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'development',
1 verbose cli '--',
1 verbose cli '--watch'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'predevelopment', 'development', 'postdevelopment' ]
5 info lifecycle @0.0.1~predevelopment: @0.0.1
6 info lifecycle @0.0.1~development: @0.0.1
7 verbose lifecycle @0.0.1~development: unsafe-perm in lifecycle true
8 verbose lifecycle @0.0.1~development: PATH: C:\User\--user--\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\project\node_modules\.bin;C:\User\--user--\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\project\node_modules\.bin;node_modules\.bin\;C:\tools\cmder\bin;C:\tools\cmder\vendor\conemu-maximus5\ConEmu\Scripts;C:\tools\cmder\vendor\conemu-maximus5;C:\tools\cmder\vendor\conemu-maximus5\ConEmu;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Python37\Scripts\;C:\Python37\;C:\tools\ruby25\bin;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\ProgramData\chocolatey\bin;C:\tools\php72;C:\ProgramData\ComposerSetup\bin;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\WINDOWS\System32\OpenSSH\;C:\Go\bin;C:\User\--user--\.dnx\bin;C:\User\--user--\AppData\Local\Microsoft\WindowsApps;C:\User\--user--\AppData\Roaming\Composer\vendor\bin;C:\User\--user--\AppData\Roaming\npm;C:\tools\cmder;C:\User\--user--\go\bin;C:\User\--user--\AppData\Local\atom\bin;C:\User\--user--\AppData\Local\Yarn\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\share\vim\vim74;C:\tools\cmder\
9 verbose lifecycle @0.0.1~development: CWD: C:\CCSDEV\UTP\app.utp.pt
10 silly lifecycle @0.0.1~development: Args: [
10 silly lifecycle '/d /s /c',
10 silly lifecycle 'cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch"'
10 silly lifecycle ]
11 silly lifecycle @0.0.1~development: Returned: code: 1 signal: null
12 info lifecycle @0.0.1~development: Failed to exec development script
13 verbose stack Error: @0.0.1 development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch"`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\User\--user--\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:203:13)
13 verbose stack at ChildProcess.<anonymous> (C:\User\--user--\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:203:13)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid @0.0.1
15 verbose cwd C:\CCSDEV\UTP\app.utp.pt
16 verbose Windows_NT 10.0.17134
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\user\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "development" "--" "--watch"
18 verbose node v12.7.0
19 verbose npm v6.5.0
20 error code ELIFECYCLE
21 error errno 1
22 error @0.0.1 development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch"`
22 error Exit status 1
23 error Failed at the @0.0.1 development script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Hello,
I'm having issues when using .version() in the following for example:
mixGlob.sass('app/Modules/**/Resources/assets/admin/sass/*.scss', 'public/css') .version();
Is this not supported or am I using it incorrectly?
throw er; // Unhandled 'error' event
^
Error: spawn npm ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:232:19)
at onErrorNT (internal/child_process.js:407:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:238:12)
at onErrorNT (internal/child_process.js:407:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
error Command failed with exit code 1.```
Not much more to mention. From NPM 7.0 onwards, my co-workers and I cannot use CTRL+C to close the processes.
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 #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
Is it possible to output the compiled sass to a single css file?
At the moment I have the following:
mixGlob.sass([
'Modules/Admins/sass/app.scss',
'Modules/!(Admins)/sass/**/*.scss'
], 'public/css/app.css')
However, this will output each sass file it finds as a single css file. I want it to compile the sass and output to a single css file.
As specified in LaravelMix doco, we can use mix.css() and mix.postCss() to compile plain css with postCss, adding autoprefixing and magic like that.
Currently running mixGlob.postCss()
or its alias mixGlob.css()
returns the error defaultMapExt: no mapping precised, neither it's supported by default
.
I tried several combinations for mapping the functions css() and postCss(), but unfortunately I wasn't able to find the working solution. Here's a snippet of what seemed to be the most sensible one (but I tried many more):
const mix = require('laravel-mix'),
mixPath = path.relative(process.cwd(), __dirname),
srcPath = mixPath + '/src',
distPath = mixPath + '/dist',
MixGlob = require('laravel-mix-glob'),
mixGlob = new MixGlob({
mix,
mapping: {
base: {
byFunc: {
css: { ext: "css" },
postCss: { ext: "css" } // I tried several combinations in the mapping section.
}
}
}
})
mix.setPublicPath(distPath)
mixGlob
.sass(srcPath + '/scss/*.scss', 'css', null, {
base: srcPath + '/scss/',
}) // this one compiles just fine.
.css(srcPath + '/libraries-override/css/*.css', 'libraries-override/css', null, {
base: srcPath + '/libraries-override/css/',
}) // this one throws the error.
Could you please indicate how should I have done the mapping? I read the doco, but I couldn't get it working.
In the end I had a look to the source and added the default mapping there:
https://github.com/MohamedLamineAllal/laravel-mix-glob/blob/master/src/index.js#L24
var mixFuncs = {
//default specifier = 'compile for all'
// usage glob => *.compile.ext to check against only compile.ext. . or *.compile.* (all extensions preceded with compile)
sass: {
ext: 'css'
},
js: {
ext: 'js'
},
less: {
ext: 'css'
},
stylus: {
ext: 'css'
},
// -- Default mapping for css() and postCss() --
css: {
ext: 'css'
},
postCss: {
ext: 'css'
},
// ------------------------------------------------
react: {
ext: 'js'
},
ts: {
ext: 'js'
},
preact: {
ext: 'js'
}
}
This made the trick.
Since .css()
and .postCss()
are anyway well documented, part of the LaravelMix API and the only way to achieve "plain" postCss processing, I would recommend to add them to the default.
I will follow up with a simple MR.
When I execute npm run dev
, I get the following error
TypeError: Cannot read property 'js' of undefined
My webpack.mix.js
file is as follows:
const mix = require('laravel-mix');
const MixGlob = require('laravel-mix-glob');
const mixGlob = MixGlob({mix});
mixGlob.js('resources/js/*.js', 'public/js/app.js', null, {
base: 'resources/js/'
})
.sass('resources/sass/*.scss', 'public/css/app.css', null, {
base: 'resources/sass/'
});
If I change the order so that the sass resources are compiled first, the error message is
TypeError: Cannot read property 'sass' of undefined
npm error log:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node@10/10.16.3/bin/node',
1 verbose cli '/usr/local/opt/node@10/bin/npm',
1 verbose cli 'run',
1 verbose cli 'dev' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle @~predev: @
6 info lifecycle @~dev: @
7 verbose lifecycle @~dev: unsafe-perm in lifecycle true
8 verbose lifecycle @~dev: PATH: /usr/local/Cellar/node@10/10.16.3/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/davidweiner/Sites/core/node_modules/.bin:/usr/local/opt/node@10/bin:/usr/local/opt/icu4c/sbin:/usr/local/opt/icu4c/bin:/Users/davidweiner/.composer/vendor/bin/:/usr/local/opt/php/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/davidweiner/Sites/core/node_modules/.bin
9 verbose lifecycle @~dev: CWD: /Users/davidweiner/Sites/core
10 silly lifecycle @~dev: Args: [ '-c', 'npm run development' ]
11 silly lifecycle @~dev: Returned: code: 1 signal: null
12 info lifecycle @~dev: Failed to exec dev script
13 verbose stack Error: @ dev: `npm run development`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/local/Cellar/node@10/10.16.3/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:198:13)
13 verbose stack at ChildProcess.<anonymous> (/usr/local/Cellar/node@10/10.16.3/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:198:13)
13 verbose stack at maybeClose (internal/child_process.js:982:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid @
15 verbose cwd /Users/davidweiner/Sites/core
16 verbose Darwin 18.7.0
17 verbose argv "/usr/local/Cellar/node@10/10.16.3/bin/node" "/usr/local/opt/node@10/bin/npm" "run" "dev"
18 verbose node v10.16.3
19 verbose npm v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error @ dev: `npm run development`
22 error Exit status 1
23 error Failed at the @ dev script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
If I remove
mixGlob.js('resources/js/*.js', 'public/js/app.js', null, {
base: 'resources/js/'
})
.sass('resources/sass/*.scss', 'public/css/app.css', null, {
base: 'resources/sass/'
});
and replace it with
mix.js('resources/js/app.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css');
it will run just fine, and I get the following lines of output:
$ npm run dev
> @ dev /Users/davidweiner/Sites/core
> npm run development
> @ development /Users/davidweiner/Sites/core
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
MixGlob:debug !!!!! ----- No debug env var ----- !!!! +0ms
MixGlob:debug env vars: +2ms
MixGlob:debug [ 'npm_config_save_dev',
MixGlob:debug 'npm_config_legacy_bundling',
MixGlob:debug 'npm_config_dry_run',
MixGlob:debug 'npm_package_devDependencies_resolve_url_loader',
MixGlob:debug 'npm_config_only',
MixGlob:debug 'npm_config_browser',
MixGlob:debug 'npm_config_commit_hooks',
MixGlob:debug 'npm_config_viewer',
MixGlob:debug 'npm_package_gitHead',
MixGlob:debug 'npm_package_scripts_watch_poll',
MixGlob:debug 'LDFLAGS',
MixGlob:debug 'npm_config_also',
MixGlob:debug 'npm_config_sign_git_commit',
MixGlob:debug 'npm_config_rollback',
MixGlob:debug 'npm_config_usage',
MixGlob:debug 'npm_config_audit',
MixGlob:debug 'npm_package_devDependencies_popper_js',
MixGlob:debug 'npm_package_devDependencies_laravel_mix',
MixGlob:debug 'NODE',
MixGlob:debug 'npm_package_dependencies_flag_icon_css',
MixGlob:debug 'npm_package_devDependencies__fortawesome_fontawesome_free',
MixGlob:debug 'npm_package_scripts_prod',
MixGlob:debug 'INIT_CWD',
MixGlob:debug 'npm_config_globalignorefile',
MixGlob:debug 'TERM',
MixGlob:debug 'SHELL',
MixGlob:debug 'npm_config_init_author_url',
MixGlob:debug 'npm_config_maxsockets',
MixGlob:debug 'npm_config_shell',
MixGlob:debug 'npm_package_devDependencies_vue_template_compiler',
MixGlob:debug 'npm_config_parseable',
MixGlob:debug 'npm_config_metrics_registry',
MixGlob:debug 'npm_config_shrinkwrap',
MixGlob:debug 'CPPFLAGS',
MixGlob:debug 'TMPDIR',
MixGlob:debug 'npm_config_timing',
MixGlob:debug 'npm_config_init_license',
MixGlob:debug 'npm_package_scripts_development',
MixGlob:debug 'Apple_PubSub_Socket_Render',
MixGlob:debug 'npm_config_if_present',
MixGlob:debug 'npm_package_devDependencies_jquery',
MixGlob:debug 'npm_package_scripts_dev',
MixGlob:debug 'npm_config_sign_git_tag',
MixGlob:debug 'npm_config_init_author_email',
MixGlob:debug 'npm_config_cache_max',
MixGlob:debug 'npm_package_devDependencies_sass_loader',
MixGlob:debug 'npm_config_preid',
MixGlob:debug 'npm_config_long',
MixGlob:debug 'npm_config_local_address',
MixGlob:debug 'npm_config_cert',
MixGlob:debug 'npm_config_git_tag_version',
MixGlob:debug 'npm_config_noproxy',
MixGlob:debug 'npm_config_fetch_retries',
MixGlob:debug 'npm_config_registry',
MixGlob:debug 'npm_package_private',
MixGlob:debug 'npm_config_versions',
MixGlob:debug 'npm_config_key',
MixGlob:debug 'npm_config_message',
MixGlob:debug 'USER',
MixGlob:debug 'npm_config_globalconfig',
MixGlob:debug 'npm_config_prefer_online',
MixGlob:debug 'npm_config_always_auth',
MixGlob:debug 'npm_config_logs_max',
MixGlob:debug 'SSH_AUTH_SOCK',
MixGlob:debug '__CF_USER_TEXT_ENCODING',
MixGlob:debug 'npm_execpath',
MixGlob:debug 'npm_config_global_style',
MixGlob:debug 'npm_config_cache_lock_retries',
MixGlob:debug 'npm_config_cafile',
MixGlob:debug 'npm_config_update_notifier',
MixGlob:debug 'npm_config_audit_level',
MixGlob:debug 'npm_config_heading',
MixGlob:debug 'npm_config_read_only',
MixGlob:debug 'npm_config_offline',
MixGlob:debug 'npm_config_fetch_retry_mintimeout',
MixGlob:debug 'npm_config_searchlimit',
MixGlob:debug 'npm_config_json',
MixGlob:debug 'npm_config_access',
MixGlob:debug 'npm_config_argv',
MixGlob:debug 'npm_package_dependencies_selectize',
MixGlob:debug 'PATH',
MixGlob:debug 'npm_config_allow_same_version',
MixGlob:debug 'TERMINAL_EMULATOR',
MixGlob:debug 'npm_config_https_proxy',
MixGlob:debug 'npm_config_engine_strict',
MixGlob:debug 'npm_config_description',
MixGlob:debug 'npm_package_scripts_hot',
MixGlob:debug '_',
MixGlob:debug 'npm_config_init_module',
MixGlob:debug 'npm_config_userconfig',
MixGlob:debug 'npm_config_cidr',
MixGlob:debug 'PWD',
MixGlob:debug 'npm_config_user',
MixGlob:debug 'npm_config_node_version',
MixGlob:debug 'JAVA_HOME',
MixGlob:debug 'npm_lifecycle_event',
MixGlob:debug 'npm_config_ignore_prepublish',
MixGlob:debug 'npm_config_auth_type',
MixGlob:debug 'npm_config_editor',
MixGlob:debug 'npm_config_save',
MixGlob:debug ... 119 more items ] +1ms
MixGlob Mix glob +0ms
98% after emitting SizeLimitsPlugin
DONE Compiled successfully in 9904ms
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.