Nov 2, 2016
0
Level 11
Spark elixir import from node_modules
I'm building a custom component for Spark and want to import a couple of node modules.
I have the two modules installed in the project ('vue-strap' and 'load-google-maps-api').
In my component, I'm able to import the load-google-maps-api no problem:
import loadGoogleMapsAPI from 'load-google-maps-api' <----- works
but can't get vue-strap to build:
import typeahead from 'vue-strap/src/typeahead' <----doesn't work
[Error: Cannot find module 'vueify' from '/web/alex/navsolo/node_modules/vue-strap']
I'm using the out-of-the-box gulp file:
elixir(function(mix) {
mix.less('app.less')
.browserify('app.js', null, null, { paths: 'vendor/laravel/spark/resources/assets/js' })
.copy('node_modules/sweetalert/dist/sweetalert.min.js', 'public/js/sweetalert.min.js')
.copy('node_modules/sweetalert/dist/sweetalert.css', 'public/css/sweetalert.css');
});
What am I missing? Can't explain why the first import works (from the node_modules dir) and not the latter...
Please or to participate in this conversation.