Error while installing via webpack
PS C:\metronic_html_v8.2.2_demo1\tools> npm run build
> keenthemes@8.2.2 build
> webpack
[webpack-cli] Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
- configuration[0].entry['js/widgets.bundle'] should be a non-empty array.
-> All modules are loaded upon startup. The last one is exported.
Replies (2)
Hi Mladen Bielicki,
Thank you for bringing this to our attention, and we appreciate your patience. We apologize for any inconvenience caused by the issue you encountered with webpack on Windows.
Your solution by replacing backslashes with forward slashes looks like a good workaround. We'll take note of this and add the necessary updates for Windows users.
If you have any further questions or encounter more issues, please don't hesitate to reach out. We value your feedback.
Thank you for your understanding.
Seams like because I'm using windows slashes were the problem in webpack.config.js file on this line
const entryPattern = path.join(srcPath, 'js/widgets/**/*.js');
To get it working use it like this
const entryPattern = path.join(srcPath, 'js/widgets/**/*.js');
let entryPatternNormalized = entryPattern.replace(/\\/g, '/');
// Widgets js
entries['js/widgets.bundle'] = glob.sync(entryPatternNormalized).map(file => file.replace(/\\/g, '/'));