jedwards1211 / meteor-imports-webpack-plugin

Webpack plugin to import and use Meteor packages like if they were real NPM packages.
MIT License
25 stars 10 forks source link

enable meteorFolder to be absolute #6

Closed jedwards1211 closed 8 years ago

jedwards1211 commented 8 years ago

before this change, if it's absolute, the webpack context gets prepended to it

luisherranz commented 8 years ago

Merged! Thanks @jedwards1211 👍

I have published it on npm as 1.0.7 as well.

jedwards1211 commented 8 years ago

You're welcome! Have you been working on Webpack 2 support by any chance? If not I may look into it soon. Also, I used this library in a new app skeleton: https://github.com/jedwards1211/crater

luisherranz commented 8 years ago

Wow, really cool project there. I'll add it to the Readme :)

I've not started working with Webpack 2 yet, so I don't know what changed. As I said in the Readme I am not actively using this plugin and my time is quite limited. But I can add you as a collaborator in the repo if you want.

Another thing I learned since I did this plugin is to use the webpack's DDL plugin. I think it's really useful and I am sure that using it for the meteor packages will improve the build times a lot.

jedwards1211 commented 8 years ago

@luisherranz Cool, thanks! So with the DLL plugin you could just make a DLL bundle of all the Meteor packages and not need to rebuild it? Btw, for my app skeleton I made a fork of this plugin that doesn't inject __meteor_runtime_config__, so that I could have the server-side rendering inject it, and all those variables could be changed at runtime instead of being baked into the client bundle.

luisherranz commented 8 years ago

So with the DLL plugin you could just make a DLL bundle of all the Meteor packages and not need to rebuild it?

Yes, that's it. You'd only need to rebuild the DLL each time you add or remove meteor packages.

Btw, for my app skeleton I made a fork of this plugin that doesn't inject meteor_runtime_config, so that I could have the server-side rendering inject it, and all those variables could be changed at runtime instead of being baked into the client bundle.

Maybe we can add a boolean to not inject __meteor_runtime_config__ like:

new MeteorImportsPlugin({
  meteorFolder: 'server',
  exclude: ['ecmascript'],
  meteor_runtime_config: false,
})

Will that work?

jedwards1211 commented 8 years ago

Yeah, sounds good to me! I'll make a PR maybe tomorrow or Tuesday