-
-
Notifications
You must be signed in to change notification settings - Fork 512
How to setup Aurelia + standard webpack (without @easy-webpack) #688
Comments
Attempted to do this once but couldn't finish. Glad you did. Thanks ! |
Thanks, we would happily accept a PR to put this into our Webpack-related docs on the Hub if you like. |
@nashwaan We would love to have this in the official documentation! If you want to create a markdown file and PR it into the docs folder of the framework, I can fix it up and get it into the docs. |
@niieani @EisenbergEffect Thank you both for your feedback. But I do have an important comment on this regard. Probably the most important two reasons why Aurelia has a big competitive advantage over other frameworks are: 1) Convention over Configuration 2) Strive for standards. Well, these are true for Aurelia framework, but not for the suggested build systems. First, aurelia-cli is not a standard scaffolding system. Yes it tries to simplify things, but all the setup and the generated config files and folders are aurelia specific (not used by any other projects). I would strongly suggest to focus on supporting the build based on standard webpack and obselete aurelia-cli and @easy-webpack. I think this will make Aurelia more standards-compliant and easier to adopt as some people are already familiar with new de facto build system, webpack. |
@niieani @EisenbergEffect @nashwaan |
@nashwaan We aren't going to obsolete the CLI. There are too many customers who love it even it its alpha form. Also, there is no standard project setup. There's no standard for that sort of thing and every platform, build system, framework, etc. does it differently. There's literally no common standard we could even try to adhere to. The problem with webpack is that it's configuration is terrible. It's one of the best modern examples I know of bad API design. Easy Webpack is a project that attempt to improve that a bit. It's not perfect because it's working on top of the flaws that exist in Webpack's design. Bazyli is working on a new webpack setup to improve things in the future. We have customers that like the CLI and we have customers that like Webpack. We support both and are always looking for ways to improve things. There isn't any kind of standard around this aspect of application development though. |
Hopefully we can integrate Webpack into the CLI, which will generate "raw" Webpack config files, and perhaps have the choice of easy-webpack as an option only. Webpack was recently working hard at improving the way you configure it, so that's bound to improve. The new Webpack docs are finally what they should've been. Eventually we want to get rid of skeletons in favor of good generators, which the CLI, essentially is. Nothing will stop you from creating your own, community driven skeletons, though. React community has their own skeleton, just as the Angular2 community has one. Maintaining them has been a real drag on our resources, so favoring the CLI will, in part, be a solution to that problem. @EisenbergEffect if you feel the CLI is ready to add support for Webpack, I could base the new setup on integrating it into it. |
@EisenbergEffect I agree to your points. I though webpack will dominate the professional-grade frontend build system for the coming few years by looking at the power of what webpack can achieve (not how to achieve).
Ouch. @niieani I really love your idea about integrating webpack directly in the CLI. That would definitely add another perspective to the CLI. Thank you for coming up with a middle ground solution. Can't wait to see this one implemented. |
Absolutely the plan is to integrate Webpack into the CLI. On Oct 6, 2016 11:52 AM, "Yousuf" [email protected] wrote:
|
@nashwaan does the loading animation still work for you with this setup? |
@nashwaan Please I tried to use your suggestion. I got the following error when I ran npm start
Please what could I have missed |
Seems like you already have something else listening on port 8080. Try changing the port of the dev server. |
@niieani Thanks a lot for your quick response. I changed the port number and it is working now. I really appreciate. |
I know this is not the right place to discuss this issue but I will appreciate if I can be helped from here. I am using the latest skeleton I guess. I was not having this issue in previous versions. When I click on a link to a route, it doesn't load the module rather it throws an error that the module could not be found. But when I refresh or go to my editor to save, which of course causes a reload, the page will appear. That error will not show again. What please is the issue? How do I resolve this? This is slowing me down. I have asked for help in the aurelia gitter forum but no one is answering me. I even tagged jsobell but no response yet. It frustrating me |
@smithaitufe Maybe your route link doesn't match a route. But it's really hard to say without seeing it. |
@Thanood Thanks but how do you explain that on page refresh, the module is loaded? I think this issue has to do with the version of aurelia-webpack-loader. I will check the previous versions of skeleton that worked for me and probably downgrade. |
Yes, you're right. I've overlooked that. Other than that, no idea, sorry. |
I have downgraded it to 1.0.0 beta 4.0.1 but it didn't work. It was throwing error due to Aurelia-validation library. I will create an issue. But do you know the skeleton releases or tag that works with the most recent version of the Aurelia validation library? |
I think I did some validation with |
I can't agree more with @nashwaan in terms of easy-webpack. I struggled with easy-webpack for hours to get something so simple as to be able to use an inline image in the src of an image tag. I still could not get it to work and all the docs only give examples of ES6 and react syntax which don't work in Aurelia. The documentation for easy-webpack is non existent - if you want to see what any sub package does - like @easy-webpack/config-fonts-and-images for example - all the github projects have zero documentation - so how are you supposed to know how to configure it? If you are new to webpack - I find easy-webpack utterly impossible to adust the config. I totally agree with @nashwaan in that there should be a regular webpack skeleton available for idiots like me who just can't understand how to configure the nuances of easy-webpack. I'm very happy @nashwaan provided this migration path from easy-webpack to regular webpack and I would suggest - replacing the existing skeleton or adding an additional skeleton that has regular webpack. |
@kingsleyh There will be an experimental version of webpack skeleton coming in the next few days that has fixes for over 20 issues related to Webpack support for Aurelia. It will not use Easy-Webpack's config packages. |
That would be totally awesome - because I'm still struggling to get my project running :) I'm looking forward to it. |
@kingsleyh Please ensure that you have checked an improved version of this guide in here or here. |
@niieani That's a really good news. I also wonder when the cli will support webpack. |
I've just converted a project from systemjs to webpack which was a tonne of trouble due to lack of documentation. I also don't like the |
There is a new version of our webpack stuff coming soon and some new docs On Nov 7, 2016 5:31 PM, "Mr Friend" [email protected] wrote:
|
I strongly feel that Aurelia should move to a more "standard" WebPack configuration as multiple user have reported that the "easy" webpack configuration is far from easy. Webpack may not be perfect, but abstracting it into a fairly unknown blackbox makes most of the documentation of Webpack useless. Aurelia is a very powerful platform but the distribution and build toolchain need loads of simplification. If I already have a default (webpack) project. How do I "npm install Aurelia" and get started, just like any other project? My suggestions are:
|
While I support this effort to demonstrate a "standard" way to produce a webpack app, I'd just like to "salt" the discussion a bit by saying that easy-webpack actually helped me (a complete webpack noob) understand what's going on. Although I do have some problems now understanding what Apart from that, easy-webpack also showed me how to modularize a webpack config myself and give standardized config artifacts to the people I work with. I don't think it should go away. Maybe complementary to the standard webpack config. |
I humbly acknowledge all the positive and negative comments about easy-webpack. The new, experimental webpack skeleton will not use easy-webpack in the form that is present today, it will expose all the raw configuration elements, so it's easy both to customize for advanced users, and to get started, for beginners. |
#714 should close this issue. No more @easy-webpack configs, it's all flat and dandy. We'll need to add more comments to each section, but otherwise, it should be much clearer now. Comments are welcome. |
Hi - I grabbed the skeleton-typescript-webpack-experimental and tried to run npm install and then npm start - however it complains of the following warnings:
consequently the dev-server won't start up. Any advice on how to fix this? |
Hi @kingsleyh skeleton-typescript-webpack-experimental is not yet released. Right now it won't work without manually building and linking its dependencies, because they were not merged and released yet. |
Hi - oh I See - so then where is the typescript webapack skeleton I should be trying out that does not use easy-webpack? |
@kingsleyh not there yet. Hang in there for a couple more days. |
ok - thanks I'll check back in a few days then. |
@niieani I found easy-webpack very helpful because it abstracted the complexities of webpack. If there is a way to use standard webpack.config.js without that abstraction and that's what the community is leaning towards, I think it is a great idea to to move towards that with the experimental-skeleton. With the current master branch, source maps are again going off by a line or two causing major annoyance during debugging. Should we wait for the experimental-skeleton to be released? I've been asking for webpack to be integrated to the aurelia-cli from the day the cli was released. It is easier to ask :) I understand that the core team members and community are doing a great job. Thank you so much for listening to our feedback and addressing them. aurelia-cli generating a standard webpack.config.js would be the ultimate and the right thing to do. It is very annoying to get latest from skeleton-webpack and diff the delta and update my project which was built using this skeleton. I'll have to do the same with aurelia-cli generated projects as well but can save a git clone :) |
@niieani, @EisenbergEffect , Could you please provide an update on the future of aurelia-webpack-skeleton and easy-webpack? We started our project with an older version of this skeleton project. While I like the idea of Aurelia trying to support require.js via aurelia CLI and webpack using the skeleton projects, it causes lot of issues because the direction is unclear. If you guys have decided to ship a webpack.config.js without easy-webpack, please do so because that would help many who are already using webpack. For all the goodness in Aurelia, we don't want this startup/skeleton projects to be a pain. At least please provide an update or let us know if we should stick with a working version of aurelia-skeleton-webpack project using easy-webpack for now. I totally understand that this is an open source project and please don't misunderstand that I'm trying to be pushy here. |
We are going to support webpack, require.js and system.js. We're currently working on an improved webpack setup. That's being done in a skeleton project. Once that is ready to go, we'll merge that into the CLI so that you can use the CLI to create either a webpack setup of a require.js setup. Eventually, we'll also add system.js support to the CLI as well. We have a very diverse community, so we want to support all the major build and bundling technologies. We're working on parallel efforts to enable that, hoping to bring it all into the CLI. |
@EisenbergEffect and @niieani is there any progress on the new webpack setup? the skeleton-typescript-webpack have not been updated for quite some time and I can't really find any progress on the new webpack support. |
i just downloaded the typescript-wepack-experimental skeleton but its also not working yet |
Not working for me either. 😞 |
I just cloned the repo and checked out the
|
I am using and yes I am using webpack-experimental branch. ` unning better-npm-run in C:\skeleton-navigation\skeleton-typescript-webpack-experimental o be executed: "$LOCAL/webpack-dashboard -- $LOCAL/webpack-dev-server --hot --inline --open" pm ERR! Windows_NT 10.0.14393 pm ERR! Please include the following file with any support request:` Thanks |
I switched to node v7.6.0 and npm v4.2.0 but no luck. Might be something to do with windows? Does looks like something do with mac/windows env. "betterScripts": { |
@activebiz that'd be my guess. Can you try running:
EDIT: @activebiz I'm guessing that 👍 means you got it to work. |
@sbolel im using node v6.9.1 and npm 3.7.5 also trying in the webpack-experimental branch |
That did worked. really liked the dashboard stuff. Hope it will work for windows when PR done in master. Any idea regarding timeline about when this will be merged into master? |
@activebiz I think npm should be accounting for this if set up properly on Windows. For now, you can replace all the environment variables in package.json (those that start with & I'm not a good person to ask about the timeline -- I have no idea 😅 |
Fixed by #714. No more easy-webpack and the config is relatively simple. |
I just downloaded the webpack+typescript skeleton from here: http://aurelia.io/hub.html#/doc/article/aurelia/framework/latest/setup-webpack/1 and it is still using easy-webpack. :-( (not only that, but when I build it, it fails, doesn't compile. just sayin'). |
Their documentation is out of date with link
here is where to go
https://github.com/aurelia/skeleton-navigation
…On Fri, Oct 13, 2017 at 10:01 AM, Doug Kent ***@***.***> wrote:
I just downloaded the webpack+typescript skeleton from here:
http://aurelia.io/hub.html#/doc/article/aurelia/framework/
latest/setup-webpack/1
and it is still using easy-webpack. :-(
(not only that, but when I build it, it fails, doesn't compile. just
sayin').
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#688 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AMuN2Je0_3pvUX1Us7fTxbE9bd0LJJHRks5sr21FgaJpZM4KOoft>
.
--
Josh Sherman
https://web-jam.com
https://www.linkedin.com/in/joshuavsherman/
540-494-8035
|
UPDATE 13-Apr-2017: With the latest update to the skeleton, the info in this post is NOT useful anymore.
UPDATE 3-Nov-2016: For a better version of this guide, see this or this.
Ok, this is not an issue any more for me. But I thought it will help someone.
Here is the process of setting up Aurelia + standard webpack based on the Aurelia official webpack skeleton.
After downloading skeleton-esnext-webpack from Aurelia github, we need to replace any reference to
@easy-webpack
with the standardwebpack
modules.In
package.json
, remove all modules that starts with@easy-webpack
in"devDependencies"
:and replace them with the following:
and use the following content for
webpack.config.js
:Now
index.html
need to be adjusted a little bit:After these steps, you can do the normal
npm install
and runnpm start
.Hope this will help someone who wants to use the standard webpack rather than @easy-webpack.
The text was updated successfully, but these errors were encountered: