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

added optional params - **fileChanged**, to be able mange manually fi… #144

Merged
merged 6 commits into from
Oct 19, 2018

Conversation

wegorich
Copy link
Contributor

@wegorich wegorich commented Jul 10, 2017

So I've got pretty annoying issue with System.js Aurelia and .html templates. First of all I have to append !text loader each time. And even I change the path at the browser-sync lvl, I still have no possibility receive events from .html change, using systemjs-plugins. code sample

So it would be really good to have possibility to override fileChanged common logic.

System.import('systemjs-hot-reload').then((connect) => {
  connect({
         fileChanged: (event, fileChanged, options)=> {
             //fix urls or other stuff...
             fileChanged(even).then(()=> {
                    //extra place for mange file reload stuff
             }); 
         }
  })
});

Copy link
Owner

@alexisvincent alexisvincent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the specific behaviour you are wanting to support here?

@wegorich wegorich mentioned this pull request Jul 10, 2017
@wegorich
Copy link
Contributor Author

Yeah, for the plugin.

In general is, I needs to mange .html templates, the hidden by the text-plugin. I don't find working solution over the systemjs plugins. And comes with idea to allow systemjs-hot-reloader user manage the files manually if needed. For example like this. Full sample attached in the top link.

if (event.url.startsWith('src/')) return;
 if (SystemJS.loads[formatTextUrl(cwd(event.url))]) {
           event.url = formatTextUrl(event.url);
 }
  
 fileChanged(event).then(()=>{
    changeAureliaFiles(event.url.split('!')[0]);
 });

@Ogglas
Copy link

Ogglas commented Oct 19, 2018

Will this be merged?

@alexisvincent alexisvincent merged commit e3cca45 into alexisvincent:master Oct 19, 2018
@alexisvincent
Copy link
Owner

🎉

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

Successfully merging this pull request may close these issues.

None yet

3 participants