webpack 4.0 and datatables.net-zf
webpack 4.0 and datatables.net-zf
So I'm running symfony 3.4.2 with webpack-encore and the foundation 6 frontend framework. I would like to use datatables + datatables.responsive + foundation 6 style with webpack/webpack-encore.
I have included the datatables libraries I would like to use in my package.json.
package.json
"datatables.net-responsive-zf": "^2.2.3",
"datatables.net-zf": "^1.10.19",
app.js
require('datatables.net-zf');
require('datatables.net-responsive-zf');
require('datatables.net-zf/css/dataTables.foundation.css');
require('datatables.net-responsive-zf/css/responsive.foundation.css');
However when I run yarn run encore dev --watch
I'm getting this error.
Running webpack ...
ERROR Failed to compile with 1 errors 17:30:47
error in ./node_modules/datatables.net-zf/css/dataTables.foundation.css
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleNotFoundError: Module not found: Error: Can't resolve '../images/sort_asc.png' in '/var/www/html/project/site/node_modules/datatables.net-zf/css'
at factory.create (/var/www/html/project/site/node_modules/webpack/lib/Compilation.js:796:10)
I've swapped out the -zf design with standard -dt via
"datatables.net-dt": "^1.10.19",
"datatables.net-responsive-dt": "^2.2.3",
and
// require datatables library js
require('datatables.net-dt');
/require('datatables.net-responsive-dt');
// require datatables library css
require('datatables.net-dt/css/jquery.dataTables.css');
require('datatables.net-responsive-dt/css/responsive.dataTables.css');
and this works. So datatables.net-dt is compiling with yarn and I can see in my /web/assets folder the generated images:
sort_asc.SOMETHING.png
sort_asc_disabled.SOMETHING.png
etc.
Am I included the foundation style incorrectly?
Answers
Looks like the images folder is missing.
An almost duplicate to your other thread .
Allan