-
Notifications
You must be signed in to change notification settings - Fork 74
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
To support apps running in docker containers #58
Comments
Or modified const oldJsxSouceInjector =
require('@babel/plugin-transform-react-jsx-source').default({
assertVersion(v) {
return v == 7;
},
}).visitor.JSXOpeningElement;
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
plugins: [
...(process.env.BABEL_ENV === 'development'
? [
() => ({
name: 'plugin-transform-react-jsx-source-with-realpwd',
visitor: {
JSXOpeningElement(path, state) {
const { REALPWD } = process.env;
if (REALPWD) {
const { filename: oldname, cwd } = state;
if (oldname && oldname.startsWith(cwd)) {
const newname = REALPWD + oldname.split(cwd)[1];
console.log(newname);
return oldJsxSouceInjector(path, {
...state,
filename: newname,
});
}
}
return oldJsxSouceInjector(path, state);
},
},
}),
]
: []),
],
}; Usage: pass env var |
The plugin isn't working for me with I copy pasted
and ran docker with But I don't believe the plugin is doing anything because it is attempting to open vscode in the same location as before I added the plugin. What am I doing wrong? Also I tried installing |
Your work has been very useful to us and makes our development easy. But there is one thing we felt that can be improved is adding support to apps running in Docker containers. We have our frontend and backend running simultaneously inside docker, so when we try to access a component it returns an error stating "This path does not exist on this computer".
We recommend a feature where we can provide a function as a prop which receives the actual path (in our case it's the path written in docker file) as input and converts that path to our current working directory.
Eg:
<ClickToComponent pathModifier={(path)=>{ const modifiedPath = actualPath + path.slice(n); return modifiedPath; }}/>
The text was updated successfully, but these errors were encountered: