-
-
Notifications
You must be signed in to change notification settings - Fork 198
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
Relax validation upon outputPath and publicPath #78
Comments
As an update here I can say that by commenting the line throwing the error I can get my webpack-dev-server working normally. It is possible to get a warning or some message instead stopping execution? thanks in advance |
@davidmpaz I'm certainly open to this - Encore purposely is "restrictive" now, to see if there are any legit use-cases. Could you post the important parts of your |
Hi @weaverryan thanks for answering. I can post relevant part but it is not more than that explained. See: let publicPath = '/static/theme.dir'
Encore
.setOutputPath('./static')
.setPublicPath(publicPath)
.setManifestKeyPrefix(publicPath) the scenario is a framework that have many modules, themes are also modules. Every module can export their own static assets to an I am affected only when trying to use dev-server. If I try to satisfy validation for making dev-server work, then I have a side effect under the manifest plugin, in manifest all urls are wrong. Currently the workaround is to modify configuration after encore generation. I need to modify dev-server and manifest plugin settings as well to make all work like expected. This is ok for me, but when trying to introduce a whole development stack to colleagues this could be a draw back, it is always good when things looks natural and not hacky :)
It is good to have Encore restrictive for ensuring good practices. I posted the issue because I think in this case restriction here is a limitation. It would be really nice if people developing with other frameworks could share experiences on this. For my specific case. A warning stating that care must be taken setting urls when developing would be as good as throwing the error. Making this validation configurable by a flag or so, also would be good too maybe. Not sure though. For building the whole project to deploy to production I don't have any issue since everything is working nice and dandy. Issue is all about improving developing experience. regards |
👍 this makes sense - you have an extra "build" step effectively that moves the assets one last time after Encore is done. I'm going to first finish #66 with a twist (#66 (comment)) and then see what needs to still be done for this. #66 isn't quite the same issue - in that case they want the |
Great!! sounds perfect. Looking forward to check it out. thanks! |
I haven't looked at this yet (but will after #96), but I think there is one tricky issue. We require the If we allow you to not intersect these - for a case like your's - how can Encore know what the contentBase (document root) should be for the dev-server? @davidmpaz you got this working with a complex hack around Encore - how was the contentBase determined? Thx :) |
I think that here:
it is been required too much, it doesn't need to be the same. That's why I think this limitation is counterproductive.
I think Encore doesn't need to know it. I am ensuring that all assets are published in document root (
the I am the opinion that Maybe is just a coincidence that it works only in my case when I remove the line throwing the error, I will try to debug what is happening in I will report back then |
Hey @davidmpaz! Here's the tl;dr of the situation. The
Without So,
|
@weaverryan thanks for the clarification. Sounds good to me to have the warning! clear message and not interrupting execution. Not serving non-webpack assets through dev-server is not a problem at all, public folder is still served by built-in server (apache, nginx or php built-in). thanks again for coming back to this. |
Closing - issue is old. Please open a new issue if needed! Thanks! |
In
getContentBase(webpackConfig)
some validation is done againstoutputPath
andpublicPath
.I think this validation is checking too much and restricting use cases possible. Could we relax this to be a warning and not error?
My use case is:
Project with custom publishing strategy. Webpack is compiling into intermediate path which is then "published" to real
publicPath
. As consequence I am facing the error thrown in line 52I think the validation should not be affected by outputPath since this can (or shall we allow it?) be anything.
I have found some other issue #59 and its PR #66 that might be related to same problem.
Does all this makes sense?
The text was updated successfully, but these errors were encountered: