require('datatables.net-buttons') has made a lot of errors
require('datatables.net-buttons') has made a lot of errors
misterztq
Posts: 5Questions: 3Answers: 0
require( 'jszip' );
require( 'pdfmake' );
require('datatables.net');
require('datatables.net-buttons');
require('datatables.net-buttons/js/buttons.flash.js');
require('datatables.net-buttons/js/buttons.html5.js');
When I use webpack to pack up, there're many errors liked Module not found: Error: Can't resolve 'fs' in '...'
This discussion has been closed.
Answers
Can you send me your webpack config file please?
Allan
const path = require("path");
const webpack = require('webpack');
const HTMLWebpackPlugin = require("html-webpack-plugin");
const CleanWebpackPlugin = require("clean-webpack-plugin");
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const config = require("./config");
let HTMLPlugins = [];
let Entries = {};
config.HTMLDirs.forEach((page) => {
const htmlPlugin = new HTMLWebpackPlugin({
filename:
${page}.html
,template: path.resolve(__dirname,
../src/html/${page}.html
),chunks: [page, 'commons'],
});
HTMLPlugins.push(htmlPlugin);
Entries[page] = path.resolve(__dirname,
../src/js/${page}.js
);});
module.exports = {
entry:Entries,
devtool:"cheap-module-source-map",
output:{
filename:"js/[name]-[chunkhash].js",
path:path.resolve(__dirname,"../dist")
},
};
You need to use client side already built version of pdfmake: