I was able to get the package found by adding the following to webpack.mix.js:
//webpack.mix.js
mix.webpackConfig({
resolve: {
alias: {
'conditional-field': 'conditional-field/dist/conditional-field.js',
}
}
});
And now I have this in my bootstrap.js file:
//resources/assets/js/bootstrap.js
window.$ = window.jQuery = require('jquery');
require('jquery-mask-plugin');
window.ConditionalField = require('conditional-field');
But now I get a console error when I try to use the plugin on the page:
// index.balde.php
new ConditionalField({
control: '.payment-radios',
visibility: {
'credit': '.credit',
'check': '.check'
}
});
Uncaught TypeError: ConditionalField is not a constructor
So I guess something about how this package was built doesn't play nice with webpack.