pim-community-dev icon indicating copy to clipboard operation
pim-community-dev copied to clipboard

How do you override .tsx files from AkeneoPimStructureBundle?

Open hoshiray opened this issue 3 years ago • 2 comments

Hi I cannot find any documentation how can I override specifically this file: src/public/bundles/akeneopimstructure/js/attribute-option/components/New.tsx

Could someone explain please? This file does not have any assigned key in requirejs.yml files

hoshiray avatar May 18 '22 11:05 hoshiray

The only way I've figured out so far is rewriting the resource path in webpack.config.js with Webpack's NormalModuleReplacementPlugin. Something like:

plugins: [
        new webpack.NormalModuleReplacementPlugin(
            /public\/bundles\/akeneopimstructure\/js\/attribute-option\/components\/New.tsx/,
            result => {
                //console.log(result);
                result.resource = result.resource.replace(
                    'public/bundles/akeneopimstructure/js/attribute-option/components/',
                    'public/bundles/myownveryspecialbundle/js/attribute-option/components/'
                );
                //console.log(result);
            }
        )]

mropanen-vincit avatar Jun 10 '22 07:06 mropanen-vincit

Is there any other way at the moment? Will there be a documentation on that in the v6?

arturLitvinavicius avatar Jun 29 '22 14:06 arturLitvinavicius