Comments (8)
The deps are in an awkward state actually, I've been thinking about it. dependencies
get installed for an npm package and any packages that depend on it. devDependencies
only get installed for the package itself -- only when you npm install
in that package's folder. But it would be weird to use this project as an npm package (i.e. npm install --save meteor-webpack-react
) so I'm thinking we should move all the deps to one or the other.
Webpack externals
doesn't quite work like that -- rather, if one webpack bundle marks react
as an external, react
doesn't get built into that bundle but it's still able to require
it from the host webpack bundle or something like that (I don't know enough to be technically precise about it).
Webpack as a resolve.alias option that would work for sharing underscore. We could do it like this:
exportUnderscore.js
:
export default window._;
webpack config:
{
resolve: {
alias: {
'underscore$': path.join(__dirname, './exportUnderscore.js');
}
}
}
from meteor-webpack-react.
Oh yeah, and right now I'm pretty sure lodash is only being used to extend the webpack configs, for instance in webpack.config.client.dev.js, which means it's not actually being built into the bundles :)
from meteor-webpack-react.
Oooh right I keep forgetting it doesn't get bundled unless you require it 😄
Using resolve for underscore might be useful if you want to do import {map, reduce} from 'underscore';
though. Not sure if it should be for the boilerplate though. The only part that makes think it should is that Meteor has a hard dependency on it so it'll be available regardless. I guess you could still do const {map, reduce} = _;
from meteor-webpack-react.
Actually the import syntax probably should work! Because it would just transpile to something equivalent to require('underscore').map
etc. The only problem is requiring internals like react/lib/...
for instance.
from meteor-webpack-react.
Actually, we should be using
externals: {
'underscore$': {
root: '_',
}
}
And I think we might as well go ahead and put this in the configs. I'm busy preparing a prototype for a demo so I don't have much time to fiddle with this project this week, but hopefully next week I can set up releases and get a lot of these issues knocked out.
from meteor-webpack-react.
Closing this (unless you think it should still be open), its worth noting that the underscore Meteor uses is super old so using the latest lo-dash offers someone semver, modular builds and more features (what i'm currently doing).
from meteor-webpack-react.
Heh, I wonder if they depend on some old behavior that got fixed? Oh well, probably not that many kb anyway
from meteor-webpack-react.
Yea they tried upgrading but minor bumps would break meteor core so it's frozen to a 2013 version lol. They talked about migrating to lodash eventually but it was low on their priorities
from meteor-webpack-react.
Related Issues (20)
- Stripe integration HOT 1
- Calling configure method of useraccounts package causes error HOT 2
- WebPack Syntax Error on Windows
- Why would dev.js build server only?? HOT 2
- CoffeeScript/ Usage with meteord HOT 2
- How to: Server side debugging? HOT 2
- npm WARN deprecated [email protected]: lodash@<2.0.0 is no longer maintained. Upgrade to lodash@^3.0.0 npm WARN deprecated [email protected]: lodash@<2.0.0 is no longer maintained. Upgrade to lodash@^3.0.0 HOT 3
- TypeError: Cannot read property 'loginButtons' of undefined HOT 4
- Screen stays at "Loading" HOT 2
- mailgun-js HOT 2
- Meteor 1.3 HOT 18
- Adding loaders to webpack.config.client.js HOT 2
- Code splitting doesn't work in production (because only main chunk gets copied to meteor folder) HOT 12
- Cannot import meteor modules HOT 1
- Problem using Elasticsearch HOT 4
- Weird debug issues -- out of the box HOT 1
- [ERROR] Cannot find Cannot find module 'temp' , core-js-no-number when running dev HOT 2
- GET http://localhost:9090/ 502 Bad Gateway HOT 6
- Trying to bundle a pure node.js application HOT 2
- Webpack issue loading static files HOT 1
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 meteor-webpack-react.