Open reohjs opened 8 years ago
I'm thinking we'd have to make meteor packages resolve only to e.g. meteor/url
or make sure they don't load before the webpack dev-server client does
I see. I guess that's because meteor packages folder is added as modulesDirectory here: https://github.com/luisherranz/meteor-imports-webpack-plugin/blob/master/index.js#L78-L81
Could you take a look to see if there's a way to modify the preference order of those modulesDirectories?
Removing those lines seems to work fine; I suspect there's another way to solve it by setting an appropriate resolve.alias configuration
Now running into the error with underscore...
I had same issue.
Removing packages folder from modulesDirectory
solved issue. (https://github.com/luisherranz/meteor-imports-webpack-plugin/blob/master/index.js#L78-L81)
Also adding alias config.resolve.alias.url = 'url/url.js';
helped.
@luisherranz Is it really necessary to have packages
as modulesDirectories
? I didn't notice any issues with my app without it.
@luisherranz Is it really necessary to have packages as modulesDirectories ? I didn't notice any issues with my app without it.
I added this to be able to use the loaders of the dependencies of this package.
I guess it's probably not needed if you are using npm@3 because all the dependencies get installed in the same node_modules
folder and webpack
should be able to find the loaders.
I'm talking by memory here, not 100% sure. If you think they should be removed, go ahead :)
In the bundle served to the client, this line in the webpack dev server client is run:
But the url module is being resolved to the Meteor URL package which is required by the HTTP package and giving a
Package is not defined
error for this line:I assume this is because whichever package exports the
Package
global hasn't run yetThis is reproducible by adding the HTTP package to the meteor app