Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Alexander
    @xenx-efy
    it is a little not logical
    codemonkeynorth
    @codemonkeynorth
    I mean doesn’t the path resolve in your code so it just pulls it from your fonts folder and shows up anyway?
    or are you getting a 404
    Alexander
    @xenx-efy
    I'm using this construction App::core()->assets()->getAssetUrl('images/progress.svg') for getting images
    and it returns path which isn't get image
    image.png
    file content looks like this ^
    codemonkeynorth
    @codemonkeynorth
    Have you edited your webpack config at all?
    Oh also check your svg have the correct header. I had trouble on a server with it not recognising them because the xml definition was missing
    Alexander
    @xenx-efy

    Have you edited your webpack config at all?

    no

    codemonkeynorth
    @codemonkeynorth
    Has this been stripped off the top off the SVG. I’m not saying it’s the issue but....
    <?xml version="1.0" encoding="UTF-8"?>
    Alexander
    @xenx-efy

    <?xml version="1.0" encoding="UTF-8"?>

    this did not help, it seems that the problem is in the configuration of the webpack.

    codemonkeynorth
    @codemonkeynorth
    are you saying the svg file actually has that error in the svg file?
    Alexander
    @xenx-efy
    this error happend because webpack put in file content instead svg tag this command export default __webpack_public_path__ + "fonts/progress.c5bcc87d11.svg";
    maybe I don't need to import images in index.js file?
    but it works with png and jpeg extensions
    codemonkeynorth
    @codemonkeynorth
    Can’t work out why it’s putting it in fonts
    Alexander
    @xenx-efy
    me too, welcome to the club)
    codemonkeynorth
    @codemonkeynorth
    I don’t see anything in the webpack config that would do that
    Alexander
    @xenx-efy
    how do it works in your case?
    maybe I really once changed config depends on it
    codemonkeynorth
    @codemonkeynorth
    I’ve never had an issue with it. However... the image you are using in your PHP code. Did you import it somewhere in the js?
    In the past I’ve added a dummy js file to do import of assets I want to use in my php code
    codemonkeynorth
    @codemonkeynorth
    'assets': utils.srcScriptsPath('assets/index.js'), added to build\webpack\entry.js this will spit out an assets.js file that doesn’t need to be used anywhere but makes sure it’s in the manifest to be accessed via the php
    then in that assets/index.js I just do my image imports
    I don’t think this is your issue though . Just saying
    Looking to see if I have an example with svg in
    codemonkeynorth
    @codemonkeynorth
    But for now you can just import in your main index to test
    Alexander
    @xenx-efy
    ok, thx
    codemonkeynorth
    @codemonkeynorth
    On a side note. If you’re using an external svg as an img src, some servers require the xml/doctype header . Let me find example
    Alexander
    @xenx-efy
    that would be nice.
    codemonkeynorth
    @codemonkeynorth
    I had to add this...
    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
    <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
    Take the space out. Should be a line break
    I’m not sure related to your issue though
    Are you using latest wpemerge version?
    Alexander
    @xenx-efy
    I think so.
    in composer.json written last
    codemonkeynorth
    @codemonkeynorth
    Check this patch is applied htmlburger/wpemerge-theme#59
    That appears to be your exact problem
    codemonkeynorth
    @codemonkeynorth
    What is @last? Did you mean @latest ? I never use it to be honest
    Maybe I’m thinking of something else
    Alexander
    @xenx-efy

    Check this patch is applied htmlburger/wpemerge-theme#59

    You’re awesome, it helps. You made my day)

    I found several changes between my version and current in github. I don't know why. Furthermore, I installed it from docs instruction.
    codemonkeynorth
    @codemonkeynorth
    Ah good!
    Sorry just to clarify, I add “assets” into the bundles array in config.json. I then create a resources/scripts/assets/index.js file where I do my imports of asset files I want to reference in php
    codemonkeynorth
    @codemonkeynorth
    The webpack process will add the images to the manifest etc but the main js file for the site does not need to increase in size because of the imports (although I’m not sure it would anyway as it’s only an import reference)
    Basically it’s a dummy unused js file , that’s just there to make sure my image references exist