-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
do not use i-frame for page content #11
Comments
I would like to build a new live.js without the i-frame. For that, i need to rewrite the servers "serveContent" response to do this:
Do you think that this would be a good solution? |
This may work if I would work with a browser extension or with a content script. We could insert the logic into the bundle, like this: {
entry: ["webpack-dev-server?http://localhost:8080", "yourEntry"]
} |
Why would the entry-array be a good place to insert that logic? a livereload option for the webpack-dev-server could be placed into the config-file. |
A inlined mode is now supported. Means you can run the webpack-dev-server without GUI/iframe. Two options to do this: (examples) add it to the entry pointYou need to pass the url to the dev-server (for socket.io connection). {
entry: ["webpack-dev-server/client?http://localhost:8080", "yourEntry"]
} as script tagadd an additional script tag to the html page: <script src="http://localhost:8080/webpack-dev-server.js"></script> |
I feel pretty stupid but I don't understand the inline mode configuration. I added main: ["../client?http://localhost:8009", "./source/main"] to the server.config.js and <script src="https://localhost:8009/webpack-dev-server.js" type="text/javascript" charset="utf-8"></script> to the aspx page. When navigating to https://localhost:8009/webpack-dev-server/, I get
What is this "client" path segment and how do I set it up correctly? |
I need to do only one of these:
In inline mode you just open Examples for |
The webpack-dev-server.js will try to connect to content-base instead of dev-server: Scenario: When i insert the script to my index.html
it will try to establish the socket.io connect to http://myserver.com (my content-base) instead of http://localhost:8009 (dev-server) |
It works with the following change in %APPDATA%\Roaming\npm\node_modules\webpack-dev-server\client\index.js: io = io.connect(scriptElements[scriptElements.length-1].getAttribute("src").replace(/\/[^\/]+$/, ""));
//io = io.connect(typeof __resourceQuery === "string" ?
// __resourceQuery :
// scriptElements[scriptElements.length-1].getAttribute("src").replace(/\/[^\/]+$/, "")
//); This is because __resourceQuery is empty, so the resulting url to connect to is server-relative. Unfortunately, running
with this configuration results in these errors:
which effectively breaks the not-inline version of the webpack-dev-server. So I guess I am still doing something terribly wrong... 😟 |
PS: npm install on the webpack-dev-server installation folder solved the prepublish script problem! All is good now. 😌 |
Ahh nice! 👍 I prefer to run the app without an iframe which makes debugging and working in the browser feel more natural. |
This is good since iFrame tends to break certain visual apps (e.g. Is there a way to disable iFrame with the 'magically generated' HTML page at |
@mattdesl You can use the entry point mode: {
entry: ["webpack-dev-server/client?http://localhost:8080", "./your/entry"]
} and use this url: |
We could add a CLI parameter that adds this entry point automatically. That would be cool... |
Many pages from my development-server will have a
X-FRAME-OPTIONS: SAMEORIGIN
response header, so it is impossible to use the development-server, since the page are displayed in an i-frame.Would it be possible to not use an i-frame?
Could it be done like livereload, where a script is added to the dom?
The text was updated successfully, but these errors were encountered: