Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Assetpath does not work in react output directory #5999

Open
3 tasks done
muthupriyashanmugam opened this issue Sep 26, 2024 · 0 comments
Open
3 tasks done

bug: Assetpath does not work in react output directory #5999

muthupriyashanmugam opened this issue Sep 26, 2024 · 0 comments
Labels

Comments

@muthupriyashanmugam
Copy link

Prerequisites

Stencil Version

4.18.3

Current Behavior

The assetDirs works well in stencil component where as try to check those component in react output, it does not work well.

The below code which i am using to copy the assetDir to the react folder. But the getAssetPath function does not work.

export const config: Config = {
  globalStyle: "src/global/global.css",
  extras: {
    experimentalSlotFixes: true,
    experimentalScopedSlotChanges: true,
  },
  namespace: "library",
  outputTargets: [
    {
      type: "dist",
      esmLoaderPath: "../loader",
      copy: [
        { src: "components/assets", dest: "build/assets" },
        { src: "components/assets", dest: "../esm/assets" },
        { src: "components/assets", dest: "../../../react-library/dist/build/assets" },
      ],
    },
    {
      type: "www",
      // serviceWorker: null, // disable service workers
      copy: [{ src: "components/assets", dest: "build/assets" }],
    },
    reactOutputTarget({
      componentCorePackage: "ai12z",
      proxiesFile: "../react-library/lib/components/stencil-generated/index.ts",
      includeDefineCustomElements: true,
    }),
  ],
  testing: {
    browserHeadless: "new",
  },
  devServer: {
    reloadStrategy: "pageReload",
  },
}
```

### Expected Behavior

The getAssetpath function should work in react component to retrieve the asset path directory.

### System Info

```shell
"@stencil/core": "^4.18.3",
"@stencil/react-output-target": "^0.5.3",
system : windows 11/ Dell
npm: "10.8.1"
```


### Steps to Reproduce

Copy the asset folder to the react folder and assessing the getAssetPath function in react component.

### Code Reproduction URL

https://github.com/muthupriyashanmugam/stencil-issue

### Additional Information

_No response_
@ionitron-bot ionitron-bot bot added the triage label Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant