Closed elambro closed 3 years ago
@elambro
Can you try:
require('laravel-mix-polyfill');
mix.polyfill({
corejs: 3,
enabled: true,
useBuiltIns: "usage",
targets: "> 0.25%, IE 11, not dead",
debug: true
});
Yep, I get the exact same error.
Okay.
So what should happen, and used to happen, is that the cacheDirectory
property is changed to false
in the object returned from the babelConfig()
function and overwrites the default value supplied by Mix.
For some reason now it does not work and Babel spits it out.
Whilst I investigate, you can add the following to your chain to do the same as debug: true
:
mix.override(webpackConfig => {
let javascriptIndex = null;
webpackConfig.module.rules.forEach(function (value, index) {
if (value['test'].toString() === '/\\.(cjs|mjs|jsx?|tsx?)$/') {
javascriptIndex = index;
}
});
if (javascriptIndex) {
webpackConfig.module.rules[javascriptIndex]['use'][0]['options']['cacheDirectory'] = false;
webpackConfig.module.rules[javascriptIndex]['use'][0]['options']['presets'][0]['options']['debug'] = true;
}
});
For reference, it was a change in Laravel Mix v6.0.14 that caused this to break.
Fixed in v3.0.1
Thanks for the package!
When adding
debug: true
to the options, I receive the following error in webpack:[webpack-cli] Error: Unknown option: .cacheDirectory. Check out https://babeljs.io/docs/en/babel-core/#options for more information about options. at throwUnknownError (/var/www/dev/dev.local/node_modules/laravel-mix/node_modules/@babel/core/lib/config/validation/options.js:135:27) at /var/www/dev/dev.local/node_modules/laravel-mix/node_modules/@babel/core/lib/config/validation/options.js:120:5 at Array.forEach (<anonymous>) at validateNested (/var/www/dev/dev.local/node_modules/laravel-mix/node_modules/@babel/core/lib/config/validation/options.js:96:21) at validate (/var/www/dev/dev.local/node_modules/laravel-mix/node_modules/@babel/core/lib/config/validation/options.js:87:10) at loadPrivatePartialConfig (/var/www/dev/dev.local/node_modules/laravel-mix/node_modules/@babel/core/lib/config/partial.js:64:50) at loadPrivatePartialConfig.next (<anonymous>) at Function.<anonymous> (/var/www/dev/dev.local/node_modules/laravel-mix/node_modules/@babel/core/lib/config/partial.js:131:25) at Generator.next (<anonymous>) at evaluateSync (/var/www/dev/dev.local/node_modules/gensync/index.js:251:28) { code: 'BABEL_UNKNOWN_OPTION' }
Usage: