Comments (6)
Thanks for letting me know about aspnet-webpack
! If this is able to provide at least as much functionality as the existing Webpack middleware mechanism and has other advantages then I'd definitely be interested in switching to it.
Can you clarify what the benefits of aspnet-webpack
are?
the middleware intercepts the request and adds the appropriate script tag on the html page so the developer doesn't have to do that as well
OK I think I follow. The Webpack middleware I've been putting in these template avoids the need to change your HTML at all by intercepting the requests for Webpack-built content and serving them using the middleware. TBH this sounds more straightforward for the developer as it's exactly the same as if you were serving pre-built files from disk (just that you don't need to have pre-built them) but please let me know if I'm missing the benefits.
from javascriptservices.
Yes you understood correctly Steve. What the aspnet-weback does in that intercepts the requests and changes the html by adding a script tag to the bundle that lives in the webpack-dev-server. In this case I am using the functionality of webpack-dev-server to just serve and update all the static resources.
I would say I tried to give a wider solution on how to use webpack with aspnet core. For the simple scenarios you don't have to write any webpack configuration file as I am using the cli with the appropriate arguments so it's easier for the developer to start with. All the configuration is in C# code and you have just to install the correct node modules, something that maybe could change. On top of that you can use aspnet-webpack for handling all static resources. In general I really believe that all the static resources (js, styles, images, fonts) should be handled with webpack and not through bower and gulp as the current templates of aspnet core applications doing.
from javascriptservices.
Cool - thanks for the info. If a good scenario for using aspnet-webpack comes up then I'd definitely be happy to look into using it. For the templates I'm working on at the moment, we certainly need webpack config files (as there are loads of possible ways you might want to configure things, and any number of third-party webpack loaders and plugins you might want to bring in).
I'll close this now as it seems like there isn't anything to do in the short term, but please let me know if you think there is.
from javascriptservices.
Just to mention I also created https://github.com/frankwallis/WebpackAspnetMiddleware which provides development middleware and hot reload support. It uses the standard webpack configuration file.
It uses NodeServices to manage the nodejs instance, but has its own nodejs host which uses a persistent socket connection for two-way communication between webpack and the asp.net server.
from javascriptservices.
Yes I am aware of your project too and I think is a nice effort. I tried to go a different route and use command line arguments as much as possible instead of configuration file to make the usage of webpack easier for the final developer. Especially in the early steps and for the most common scenarios.
from javascriptservices.
Yes I took the view that all the configuration should remain in the webpack config file as that is what will be used when the app is being bundled for production and on the CI server. It also means there is less work to document your own configuration API and to keep up to date with any changes to the webpack API, I think that is important in these kind of 'adapter' projects. Your way may well be easier to get up and running with though, it's horses for courses I suppose.
from javascriptservices.
Related Issues (20)
- package reinstall HOT 2
- s
- Uncaught ReferenceError: vendor_ is not defined when using DllReferencePlugin HOT 5
- aspnet-webpack support? HOT 2
- Module not found : error : Can't resolve './../$$_gendir/ClientApp/app/app.browser.module.ngfactory' HOT 1
- Buffer is deprecated in Node 10
- Expose some of the internal classes HOT 1
- React+Redux Template does not compile with --strict HOT 1
- JavaScriptServices vs Templating github HOT 1
- SSR with Vue requires javascript enabled? HOT 2
- What happened to the template in .NET Core 2.1?
- Ignore
- Delay in domain-task Promise Resolution when Server Side Rendering HOT 1
- How to publish the javascriptservices project (asp.netcore rest api project which uses node api) to IIS 8. The application not wroking after publishing to IIS HOT 2
- UseProxyToSpaDevelopmentServer doesn't auto-refresh browser using an Aurelia ClientApp with HMR HOT 3
- Release date for angular 6 template ? HOT 1
- Using Angular template - all routes are directing to Angular app directly, unable to implement ASP.NET /API route HOT 2
- Files being written to disk with WebpackDevMiddleware HOT 1
- The request matched multiple endpoints HOT 1
- Need clarification
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from javascriptservices.