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

[Feature Rueqest] Force update for scripts under development #767

Closed
momocow opened this issue Sep 21, 2019 · 3 comments
Closed

[Feature Rueqest] Force update for scripts under development #767

momocow opened this issue Sep 21, 2019 · 3 comments

Comments

@momocow
Copy link

momocow commented Sep 21, 2019

Hi, I've created a Webpack plugin for developers to develop userscripts with powerful Webpack toolchains.

The plugin actually prepends the meta block to output scripts, and also generates the corresponding *.meta.js along with each script.

Developers can benefit from using the plugin along with webpack-dev-server to serve the output files in watch mode. Once modification on source files are saved, the output files are compiled. Also a build number can be appended to the version string to force the version increase.

To test the scripts, an URL pointed to the output of the webpack-dev-server can be used to install the script to TM. However, after every change of source files, developers should manually click the update button provided by TM to update the script.

By default, the dev-server will reload/refresh the page when file changes are detected.

As described in the webpack doc, devServer.liveReload configuration, the webpack-dev-server is able to reload the page on sources changed, the problem is that TM does not get informed about the change thus there is no update to the script.

I'm asking if there is a way to force TM update the script when page reload (which means sources changed), the feature can be enabled only if you know you're developing on specific script, to avoid annoying normal users. (or is there any existing solution to make the dev flow works?)

Any feedback is appreciated, thanks!

@derjanb
Copy link
Member

derjanb commented Oct 16, 2019

Simply copy your script header to Tampermonkey, then @require the real script as external resource and enabled "Advanced" "Config Mode" to be able to set "Externals" > "Update Interval" to "Always"

@derjanb derjanb closed this as completed Oct 16, 2019
@kinesisweb
Copy link

On a related note to this issue, would it be possible to fix the external resource refresh mechanism.

If I have a webpack devServer running, I have my development script proxied as an external request and I have Update Interval -> Always set as an option.... the devServer will trigger a page refresh in my browser when the script changes, but I'll still have to manually refresh my browser 2 or 3 times before the new script kicks in.

@Kane-Kuroneko
Copy link

On a related note to this issue, would it be possible to fix the external resource refresh mechanism.

If I have a webpack devServer running, I have my development script proxied as an external request and I have Update Interval -> Always set as an option.... the devServer will trigger a page refresh in my browser when the script changes, but I'll still have to manually refresh my browser 2 or 3 times before the new script kicks in.

please reopen this , issue still exsist yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants