Comments (13)
Have talked a few times on this. I think the learning cam be structured into:
- entry
- output
- loaders
- plugins
Ideally we'd stub these out separately. Maybe
from webpack.js.org.
https://docs.google.com/presentation/d/10mIapWjv1pyUQaMv6G8MCdoe9OK2Ey8zz-CLkHuFdRI Also has my slides with maybe valuable details or metaphors etc.
from webpack.js.org.
Had an extended discussion in Reactiflux with someone who was struggling with the idea of process.env.NODE_ENV
, how it's used in optimizing client-side libs, and how it actually relates to Node itself. Seems like this would be an excellent set of concepts to add to Webpack's docs. I realize it's not strictly a Webpack-specific concept, but it definitely shows up in most "real" Webpack configs, and I'm not seeing any blog posts or discussions that really clarify how the value of NODE_ENV
is used in client libs, how DefinePlugin+UglifyJS optimizes those, and how people usually associate the value of NODE_ENV
in their Node build script with the value in their transformed client code.
I've exported the extended conversation I had to a gist over at https://gist.github.com/markerikson/ead940a93a2a877dc97824e5f839840f. I think the summary explanation I put together for how these pieces relate is useful, and the points made by Steven regarding familiarity with these concepts and having the docs include a friendly "here's EVERYTHING you need to get started" are fairly reasonable.
I've also put up a shortened version of the conversation with just my explanations over at https://gist.github.com/markerikson/6776848172c33aaa4db882627c689e18 .
from webpack.js.org.
I can take a crack at it during the week, I think.
from webpack.js.org.
Any snippets written somewhere @TheLarkInn? I recon those would be really helpful.
The TL;DR as far as I understand is:
entry
: Specifies the files that webpack starts from and builds a dependency tree. Each of these can (must?) build a separate bundled file with all of the dependencies included.output
: Specifies the format of the bundled file, including naming, exports, etc.loaders
: Functions which certain files can be ran through. They help webpack understand certain types of files. For example thecss-loader
for CSS files.plugins
: Extend the webpack functionality and can be customized by the user.
Does that seem about right?
from webpack.js.org.
My current prototype has an entire section for concepts.
from webpack.js.org.
Ooooh nice, I love the Everything is a module
section, that took me a while to get!
from webpack.js.org.
Wow! That's a very good explanation of how plugins and loaders work.
On Sunday 10 July 2016, Sean Larkin [email protected] wrote:
https://docs.google.com/presentation/d/10mIapWjv1pyUQaMv6G8MCdoe9OK2Ey8zz-CLkHuFdRI
Also has my slides with maybe valuable details or metaphors etc.—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#33 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAZd9Oy1FqXYE2yPRD6mJYaWZOzqyyqKks5qUSKCgaJpZM4JF7IH
.
Regards,
Pavithra.K
from webpack.js.org.
Who's the audience for the guide?
I'd be tempted to start at a much earlier point than bundles and chunks. People coming into Webpack from browser-only development don't have all of the intermediate concepts yet:
- introduce the idea of a module and the use of the
require
function to express dependencies, - explain some of the rationale and demonstrate that it's useful (possible examples: jquery-as-a-library, maybe?)
- introduce the idea of a bundle (a single javascript file containing many modules, plus the code necessary to load them). People coming in from Node or Browserify can start here.
- re-introduce the idea of an entry point - JS developers will already be familiar with them, Webpack changes the context a bit but doesn't fundamentally alter the idea
Once users get from zero to simple bundles, then elaborate onto kinds of sources other than pure javascript by explaining loaders and plugins, production builds, etc. - all of that is very high level and may even deserve its own "Production Builds" doc.
from webpack.js.org.
I agree with @ojacobson. Having a visual analogy even that depicts that dependencies in a web application are not limited to javascript files. Urls referenced in css, url's referenced in html, @imports in css to other files, etc. (Because webpack treats everything as a module). Explaining that webpack helps solve a web applications complete dependency tree etc.
@ojacobson, if I make a "sub"-issue from this one, would you be willing to write some of this introductory to webpack concepts in the issue for pseudo review.
from webpack.js.org.
#38 For you!
from webpack.js.org.
I split this up into an entire section. There's also a label.
Let's leave this issue open for discussion, though.
from webpack.js.org.
Time to close.
from webpack.js.org.
Related Issues (20)
- Use composite action for webpack persistent caching
- Bug: Broken Link to CommonJS Specification HOT 3
- Documentation change for clarification in asset management HOT 1
- Document webpack change: feat: support for un-managed snapshot path
- Document webpack change: add node-module option for node.__file/dirname
- Document webpack change: feat: move css exportsOnly to css generator options
- Document webpack change: fix: `Server` and `Dirent` types HOT 1
- webpack breaking issue HOT 1
- splitChunks maxSize/minSize/maxRequest priority HOT 1
- Document webpack change: feat: add warning for asyncModule
- Why `optimization.removeAvailableModules` is default to `false`?
- Update webpack-dev-server documentation HOT 1
- Document webpack change: feat: support css local ident name HOT 1
- Document webpack change: fix: use LZW to compress css head meta
- Document webpack change: fix: resolve's plugins types
- Document webpack change: feat: allow to customize the stage of BannerPlugin
- meta[name=theme-color]' is not supported by Firefox, Firefox for Android.
- Document webpack change: feat(css): allow to use default and named export
- > It is already implemented, `webpack-cli init`, soon we will implement more templates HOT 1
- Document webpack change: feat: support `node:` prefix for Node.js core modules in runtime code
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 webpack.js.org.