Installed tiny-slider via npm, then it created on node_modules the folder tiny-slider, then in app.js I tryed the following and nothing works:
require('tiny-slider');
import 'tiny-slider/src/tiny-slider';
require('tiny-slider/src/tiny-slider');
import 'tiny-slider/src/tiny-slider.js';
import 'tiny-slider/src/tiny-slider.module.js';
tryed pointing on dist too and also like documentation says:
import { tns } from "./node_modules/tiny-slider/src/tiny-slider"
import {tns} from './src/tiny-slider.js';
import { tns } "tiny-slider/src/tiny-slider";
@CristianEstiber
I have tiny-slider working with laravel mix
import { tns } from 'tiny-slider/src/tiny-slider;
let slider = tns({
//place parameters here
});
From my understanding you need to ensure that you are calling the tns object otherwise webpack will not load the package into your bundle.
Hope this helps!
@mdvacula is right but the last quote is missing:
import { tns } from "tiny-slider/src/tiny-slider";
Another thing to note is that you have to import tns in the file where you are using tns otherwise it won't work. For example, if you have a custom.js file where you are using tns and which is being required via app.js then you have to add the import in custom.js and not app.js
Most helpful comment
@CristianEstiber
I have tiny-slider working with laravel mix
From my understanding you need to ensure that you are calling the tns object otherwise webpack will not load the package into your bundle.
Hope this helps!