Bonjour à tous,
Pour un projet je dois mettre en place la librairie IAB qui est un SDK JS pour gérer le consentement des régies publicitaires. Voici le lien :
https://github.com/InteractiveAdvertisingBureau/Consent-String-SDK-JS
Sur la doc, il est clairement indiqué :
You will need webpack or a similar module bundler to correctly pack the library for use in a browser.
Ors je n'arrive pas à récupérer la librairie pour pouvoir l'utiliser dans mes fichiers JS. Auparavant, je travaillais avec Gulp, et j'ai converti tout mon gulpfile sous Webpack (Laravel). Voici mon webpack.js :
let mix = require('laravel-mix');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for your application, as well as bundling up your JS files.
|
*/
let js = {
jquery: './node_modules/jquery/dist/jquery.js',
bootstrap: './node_modules/bootstrap-less/js/bootstrap.js',
sweetalert: './node_modules/sweetalert/dist/sweetalert.min.js',
jssocials: './node_modules/jssocials/dist/jssocials.js',
bootstrap_select: './node_modules/bootstrap-select/dist/js/bootstrap-select.js',
charts: './node_modules/chart.js/src/chart.js',
notify: './bower_components/remarkable-bootstrap-notify/dist/bootstrap-notify.js',
accelerator: './node_modules/page-accelerator/dist/page-accelerator.min.js',
at: './bower_components/At.js/dist/js/jquery.atwho.js',
caret: './bower_components/Caret.js/dist/jquery.caret.js',
jsCookie: './node_modules/js-cookie/src/js.cookie.js',
lightbox: './node_modules/ekko-lightbox/dist/ekko-lightbox.js',
consentString: './node_modules/consent-string/dist/consent-string.js',
};
/**
* Scripts
*/
mix.scripts([
'resources/assets/js/common.js',
'resources/assets/js/actions.js',
'resources/assets/js/ajax.js',
'resources/assets/js/components.js',
'resources/assets/js/smileys.js',
'resources/assets/js/notifications.js',
'resources/assets/js/data.js',
'resources/assets/js/app.js'
], 'public/js/app.js').version();
// Composants classiques
mix.scripts([
js.sweetalert,
js.jssocials,
'resources/assets/js/slidebar.js',
js.bootstrap_select,
js.notify,
js.jsCookie,
], 'public/js/components.js').version();
mix.scripts([
'resources/assets/js/admin.js'
], 'public/back-cockpit/js/admin.js').version();
// Tableaux
mix.scripts([
js.charts
], 'public/js/charts.js');
// Suggestion
mix.scripts([
'resources/assets/js/suggest.js'
], 'public/js/suggest.js');
// Consentement
mix.scripts([
'resources/assets/js/consent.js',
], 'public/js/consent.js');
// Mention des commentaires
mix.scripts([
js.caret,
js.at
], 'public/js/mention.js');
// Date Picker
mix.scripts([
'resources/assets/js/bootstrap-datepicker.js'
], 'public/js/bootstrap-datepicker.min.js');
// Utilisateurs premiums
mix.scripts([
'resources/assets/js/premium.js'
], 'public/js/premium.js');
// Bannière application mobile
mix.scripts([
'resources/assets/js/banner.js'
], 'public/js/banner.js');
mix.copy('resources/assets/imgs', 'public/imgs');
// Ficher CSS principal
mix.less('resources/assets/less/bootstrap.less', 'public/css/bootstrap.css').version();
mix.less('resources/assets/less/app.less', 'public/stylesheets/app.css');
mix.less('resources/assets/less/slidebar.less', 'public/stylesheets/slidebar.css');
mix.styles([
'public/stylesheets/app.css',
'public/stylesheets/slidebar.css'
], 'public/css/rugbynistere.css').version();
// Components
//mix.sass('resources/assets/sass/jssocials.scss', 'resources/assets/css/jssocials.css');
mix.sass('resources/assets/sass/sweetalert.scss', 'public/stylesheets/sweetalert.css');
mix.styles([
//'resources/assets/css/jssocials.css',
'public/stylesheets/sweetalert.css'
], 'public/css/components.css').version();
// Fichiers CSS pour les articles & TinyMCE
mix.less('resources/assets/less/forms.less', 'public/stylesheets/css/forms.css');
mix.less('resources/assets/less/facebook.less', 'public/stylesheets/facebook.css');
mix.less('resources/assets/less/tinymce.less', 'public/stylesheets/tinymce.css');
mix.styles([
'public/stylesheets/forms.css',
'public/stylesheets/facebook.css'
], 'public/css/articles.css').version();
mix.styles([
'public/stylesheets/forms.css',
'public/stylesheets/facebook.css',
'public/stylesheets/tinymce.css'
], 'public/css/tinymce.css').version();
// Composants divers
mix.less('resources/assets/less/widgets.less', 'public/css/widgets.css');
//mix.less('resources/assets/less/admin_articles.less', 'public/css/admin_articles.css');
mix.less('resources/assets/less/premium.less', 'public/css/premium.css').version();
mix.less('resources/assets/less/timeline.less', 'public/css/timeline.css').version();
// Plugins
mix.less('resources/assets/less/datepicker.less', 'public/css/bootstrap-datepicker.min.css');
mix.less('resources/assets/less/mention.less', 'public/css/mention.css');
mix.styles('resources/assets/css/banner.css', 'public/css/banner.css');
// Place To Rugby
mix.less('resources/assets/less/the-place-to-rug-be.less', 'public/css/the-place-to-rug-be.css').version();
J'ai tenté de récupérer de plusieurs manières le code, en utilisant extract, en incluant la variable dans mon webpack, mais rien a faire =/
Si quelqu'un avait la solution ça m'aiderait vraiment à avancer =)
Un grand merci à vous !