-
Notifications
You must be signed in to change notification settings - Fork 11.8k
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
Toolkit: Wrong publicPath used for plugin files #40671
Comments
should be publicPath: `public/plugins/${getPluginId()}`, There could be some problems if some plugins based the code that it loads code from the base. |
A workaround is to create a webpack.config.js with this content (in the root of your plugin) webpack.config.js module.exports.getWebpackConfig = (config, options) => ({
...config,
output: {
...config.output,
publicPath: 'public/plugins/plugin-id/',
},
}); The plugin id is the id written in the plugin.json file. |
Because of this issue grafana/grafana#40671, the publicPath needs to be set to the plugin path. Closes #48
You are correct! However we are a bit hesitant to introduce this into the I will add this to the documentation about how to dynamically import modules in your plugin. |
What happened:
When using dynamic imports the code tries to retrieve the file from the base.
What you expected to happen:
The code should retrieve the code from the plugin path.
How to reproduce it (as minimally and precisely as possible):
Create a plugin.
Create a file to import
test.ts
import the file
panel.ts
Anything else we need to know?:
Environment:
The text was updated successfully, but these errors were encountered: