Hectix's avatar

Node modules plugin not defined

Hi guys, when I mix these two scripts, one is feather icons library and article.js is my custom script:

mix.js(['node_modules/feather-icons/dist/feather.js','resources/js/project/create/article.js'], 'public/js/article.js')

In my custom script article.js when I try to use feather.replace(); I'm getting error that feather is not defined, even though I'm putting in into mix.js();

0 likes
2 replies
Hectix's avatar

I'm now using extract function like:

mix.js(['resources/js/project/create/article.js'], 'public/js/article.js')
    .extract(['feather'])
    ...

Including it like

<script src="{{asset('js/manifest.js')}}"></script>
<script src="{{asset('js/vendor.js')}}"></script>
<script src="{{asset('js/article.js')}}"></script>

article.js:

 feather.replace()

But still got the error feather is not defined

Please or to participate in this conversation.