question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

overriding loaders

See original GitHub issue

Description:

Right now there is no way to override a load

if i set

mix.webpackConfig({
module: {
        rules: [
            {
                test: /\.jsx?$/,
                exclude: /node_modules\/(?!(vue-strap)\/).*/,
                loader: 'babel-loader' + mix.config.babelConfig()
            }
        ]
    }
});

nothing will happen and my loader will not get executed since they go by order and the original one defined in mix config will be used.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

30reactions
domstubbscommented, Jul 11, 2017

It took forever to pin it down, but I eventually managed to get ES5 transpiling working with Foundation with the following config:

mix.js('src/app.js', 'public/')
    .webpackConfig({
        module: {
            rules: [
                {
                    test: /\.jsx?$/,
                    exclude: /node_modules(?!\/foundation-sites)|bower_components/,
                    use: [
                        {
                            loader: 'babel-loader',
                            options: Config.babel()
                        }
                    ]
                }
            ]
        }
    });
0reactions
tpraxlcommented, Feb 10, 2018

This Config seems to refer to the global Config object. Try using lowercase config, as this is exported by mix:

// node_modules/laravel-mix/src/index.js
…
module.exports = api;
module.exports.mix = api; // Deprecated.
module.exports.config = Config;
Read more comments on GitHub >

github_iconTop Results From Across the Web

Best Practices for overriding loader options · Issue #756 - GitHub
we're using babel-plugin-react-css-modules which supports "anonymous" - re: unreferenced according to webpack - classes. i needed to override ...
Read more >
OverridingClassLoader (Spring Framework 6.0.3 API)
Determine whether the specified class is eligible for overriding by this class loader. ... Load the defining bytes for the given class, to...
Read more >
How to override a webpack loader based on specific require ...
Found my answer at Webpack - ignore loaders in require()?, Basically I need !! before the require to ignore the pre loaders and...
Read more >
Loaders - webpack
It's possible to override any loaders, preLoaders and postLoaders from the configuration by prefixing the inline import statement:.
Read more >
Overriding Widgets templates not working (following help ...
Using Django 4, Here it explains how to override a widget template: Each ... In django/template/loaders/filesystem.py in the method def ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found