bootstrap-autocomplete icon indicating copy to clipboard operation
bootstrap-autocomplete copied to clipboard

How to import into webpack build?

Open chrisribal opened this issue 4 years ago • 2 comments

Hi, i wanted to use the library in my webpack project. Unfortunately i can't find a way to import the library in my project.

I installed the library using npm: npm install --save bootstrap-autocomplete

Then i tried to use the following js:

const jQuery = require('jquery');
const $ = jQuery;

import autoComplete from 'bootstrap-autocomplete';
$('.search-input').autoComplete(); // --> autoComplete ist not a function

I also tried unnamed imports or required imports, but still no luck.

Unfortunately i can't really figure out the module exports, because the main js file is minified.

What am i missing? Thank you!

chrisribal avatar Apr 30 '21 10:04 chrisribal

I used it in a webpack environment import it as folowing:

import 'bootstrap-autocomplete/dist/latest/bootstrap-autocomplete';

xcash avatar May 04 '21 11:05 xcash

Write something in the docs in release 3.0.0

xcash avatar Jun 18 '21 06:06 xcash