Customize Webpack configuration

hey jeff,

I had a similar issue with window related to Konva. I dont know if this will help you but here is how I solved it in my project:

const webpack_1 = require("webpack");

export const webpack = ({ config, mode }) => {
  if (mode === "development") {
    config.devtool = "eval-cheap-source-map";
  config.plugins.push(new webpack_1.IgnorePlugin(/canvas|jsdom/, /konva/));

It basically adds the package to the ignore plugin to prevent the compilation error.

1 Like

Hi guys ! I’m quite new to frontity but I assume the solution will work for my needs as I don’t wan’t to rewrite all the various calls to my wordpress rest api.
Thanks a lot then.
What I’m doing with it is a React-Three-Fiber (3D) app that needs “glb or gltf” files to be loaded, so I wanted to open a new topic but this one seems to go straight to my problem :

  • Modifying my webpack.config.js

First of, It’s quite unclear for me about how to add the frontity.config.js (where ? in the root folder or in my brand new custom theme package ?)
// Sorry about this last point it was quite clear in description that it could be created at both locations

Then I’d like to know if it’s possible to provide an example of how to allow new filetypes ?
(there’s the codeSandBox from @SantosGuillamot that seems to be functionnal as it has been released but I already tried it and I don’t manage to remove this sticky log that I’ve put in my “home” component, --production tried).

Then what I’ve tried is that, located at the root :

Sorry if I landed the wrong place.
I’ll set a gravatar but it’s my professionnal address and i’d prefer to choose it wisely :blush:
Have a nice day !

1 Like