scottcharlesworth / laravel-mix-polyfill

A Laravel Mix extension to include polyfills by using Babel, core-js, and regenerator-runtime
MIT License
50 stars 7 forks source link

Can't resolve core-js in component files #28

Closed jmurphy45 closed 4 years ago

jmurphy45 commented 4 years ago

I am trying to setup polydill for the current project i am working on. I followed the installation steps and getting many errors about not being about to resolve core-js modules. Below is how my mix file looks:

const mix = require('laravel-mix');
require('laravel-mix-polyfill');
mix.js('resources/js/app.js', 'public/js')
    .polyfill({
        targets: { "ie": 11}
    })

I have not found any solutions online to over come this bug/issue.

jmurphy45 commented 4 years ago

Error Example

ERROR in ./resources/js/components/AddPart.vue?vue&type=script&lang=js& (./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/AddPart.vue?vue&type=script&lang=js&)
Module not found: Error: Can't resolve 'core-js/modules/es.string.trim' in '/Users/jmurphy/workspace/studyup/resources/js/components'
 @ ./resources/js/components/AddPart.vue?vue&type=script&lang=js& (./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/AddPart.vue?vue&type=script&lang=js&) 6:0-40
 @ ./resources/js/components/AddPart.vue?vue&type=script&lang=js&
 @ ./resources/js/components/AddPart.vue
 @ ./resources/js sync \.vue$/
 @ ./resources/js/app.js
 @ multi ./resources/js/app.js ./resources/sass/app.scss ./resources/sass/login.scss