Babel won't transpile Vue dependencies

371 Views Asked by At

I have a Vue.js Single File Component which depends on primevue/AutoComplete.vue. When transpiling the code for IE11 (I know, I know) the files produced from AutoComplete.vue are ignored and therefor not transpiled resulting in errors in Internet Explorer.

I have adjusted my babel-loader config as described here and the relevant part of my webpack config now looks like this:

            {
                test: /\.vue$/,
                loader: 'vue-loader'
            },
            {
                test: /\.js$/,
                use: [
                    {
                        loader: 'babel-loader',
                        options: {
                            exclude: file => (/node_modules/.test(file) && !/\.vue\.js/.test(file))
                          },
                            presets: [
                                ["@babel/preset-env",
                                    {
                                        "useBuiltIns": "usage",
                                        "debug": true,
                                        "modules": false,
                                        "corejs": { version: "3.6", proposals: true }
                                    }
                                ]
                            ]
                        }
                    }
                ]
            },

Looking at the suggested exclude function, it relies on files having the suffix e.g. AutoComplete.vue.js but when I log the "file" parameter, I don't see any file with this suffix.

How is it supposed to filter the nested Vue dependencies if the proposed file ending isn't provided by vue-loader ? Am I missing these dependencies because of a config error ?

0

There are 0 best solutions below