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

Add support for HTML injection #1817

Merged
merged 2 commits into from
Jan 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions assets/build/webpack.config.watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ module.exports = {
target: config.devUrl,
proxyUrl: config.proxyUrl,
watch: config.watch,
delay: 500,
Copy link
Contributor

Choose a reason for hiding this comment

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

In the case you're editing a file that causes a refresh and you save the file multiple times, there's the possibility that you get an outdated version if the browser is in the middle of a refresh when the save is detected.

I ran into this and used reloadDebounce instead. Seems pointless to trigger multiple refreshes in a row anyways.

Copy link
Member Author

Choose a reason for hiding this comment

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

The delay is an arbitrary one set by my plugin to invoke a delay between local file system updates and injection/reload by BrowserSync. This is to resolve an issue with BrowserSync reloading before the server (i.e., VM) has synchronized with local file changes. My plugin by default has this value set to 50ms, but it's 500ms in Sage because I'm assuming that most developers are using a VM.

Anyway, I could add a separate option for debounce as well, or possibly refactor my current implementation to use debounce instead. I'll look into it and do some tests.

}),
],
};
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,17 @@
"autoprefixer": "^6.6.1",
"body-parser": "^1.16.0",
"browser-sync": "^2.18.6",
"browsersync-webpack-plugin": "^0.3.3",
"browsersync-webpack-plugin": "^0.4.1",
"bs-html-injector": "^3.0.3",
"buble": "^0.15.2",
"buble-loader": "^0.4.0",
"clean-webpack-plugin": "^0.1.15",
"css-loader": "^0.26.1",
"cssnano": "^3.10.0",
"eslint": "^3.13.1",
"eslint": "^3.14.0",
"eslint-loader": "^1.6.1",
"eslint-plugin-import": "^2.2.0",
"extract-text-webpack-plugin": "^2.0.0-beta.4",
"extract-text-webpack-plugin": "^2.0.0-beta.5",
"file-loader": "^0.9.0",
"glob": "^7.1.1",
"imagemin-mozjpeg": "^6.0.0",
Expand All @@ -53,7 +54,7 @@
"minimist": "^1.2.0",
"node-sass": "^4.3.0",
"optimize-css-assets-webpack-plugin": "^1.3.0",
"postcss": "^5.2.10",
"postcss": "^5.2.11",
"postcss-loader": "^1.2.2",
"qs": "^6.3.0",
"resolve-url-loader": "^1.6.1",
Expand Down
Loading