-
-
Notifications
You must be signed in to change notification settings - Fork 4.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
allow publicPath in dev mode and do not automatically set nuxtStatic #279
Conversation
Codecov Report
@@ Coverage Diff @@
## 0.9.10 #279 +/- ##
=======================================
+ Coverage 99.29% 100% +0.7%
=======================================
Files 11 11
Lines 426 422 -4
=======================================
- Hits 423 422 -1
+ Misses 3 0 -3
Continue to review full report at Codecov.
|
…ack publicPath (it is also generating //_nuxt/ intead of /_nuxt/)
@@ -80,7 +80,7 @@ export function renderRoute (url, context = {}) { | |||
if (!context.nuxt.serverRendered) { | |||
app = '<div id="__nuxt"></div>' | |||
} | |||
const publicPath = self.options.build.publicPath.indexOf('http') === 0 ? self.options.build.publicPath : urlJoin(self.options.router.base, self.options.build.publicPath) | |||
const publicPath = self.options.build.publicPath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why removing the ternary? If the public path is /app/
and router.base
is /my-site/
, publicPath should be /app/my-site/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Atinux with the current code urlJoin(self.options.router.base, self.options.build.publicPath)
wouldn't that end up being /my-site/app/
which is wrong?
The html files this variable is for rendering are the files generated by webpack and not handling the inner routes of the app. So in my opinion, the router.base
shouldn't come into play.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Atinux this does lead into a bigger question I had when going through |
@cj actually, when you want to host your application made with
|
Hi @cj I implemented in the next release. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This refers to #25 and will allow you to use CDN's like cloudfront by setting the
build.publicPath
, it will also allow you to use nuxt with platforms like cordova because indev
mode you need to point to the full internal ip path likehttp://${host}:${port}/_nuxt/
to run on emulators or connected devices.