DataTables Concated Script in Webpack throws error
DataTables Concated Script in Webpack throws error
Can't resolve 'datatables.net-bs'
mix.js('resources/assets/js/app.js', 'public/app.min.js')
// app.js file
import {} from '@/public/assets/js/DataTables/dataTables.Responsive.Buttons';
const app = function(){
return {
init : function(){
console.log($.fn.dataTable);
}
};
}();
(function (app) {
app.init();
return app;
}(app));
I can't use as // CommonJS is calling
I want to call else part of code
// Browser
factory( jQuery, window, document );
How to configure webpack to allow me to call browser part
This question has an accepted answers - jump to answer
Answers
Do you have some kind of configuration somewhere telling webpack that
datatables.net-bs
is in your concatenated script?Allan
No.
I build 'public/assets/js/DataTables/dataTables.Responsive.Buttons.js'
which is concatenated of different plugins.
I created datatables.js which is concanated of other dataTable plugin files.
Now I import that file and run mix.js which calls commonjs portion in datatable.js which have dependency of require('datatable.net');
now I don't want to use package.js to include that package still want to use that plugin.
I want to restrict that plugin from node_modules so I can use my concanated plugin file and import that file.
I'm afraid that I'm out of my depth with that one in that case. You'll need to ask in a WebPack specific forum.
Allan
Ok thank you