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

Does not seem to work with webpack2 #13

Closed evelant closed 7 years ago

evelant commented 8 years ago

I am trying to use this with https://github.com/jedwards1211/crater on webpack2. On the client var config = require('./meteor-config.json'); in meteor-imports.js is always an empty object instead of the config. It seems like json-string-loader is not inserting the config for some reason.

compiler.options.module.loaders.push({
      meteorImports: true,
      test: /\.json$/,
      loader: 'json-string-loader?json=' + JSON.stringify(self.config)
    });

Unfortunately I am fairly new to webpack and am out of ideas about how to debug this.

jedwards1211 commented 8 years ago

Probably something has changed in Webpack 2 (which I'm sure will happen during beta stage), I'll look into it eventually. Does it work with webpack-2.1.0-beta.22?

evelant commented 8 years ago

@jedwards1211 beta22 works. Beta 23+ fails. I have tried all sorts of stuff but in beta23+ it seems webpack simply will not resolve meteor-config with the json-string-loader.

jedwards1211 commented 7 years ago

@fignuts I don't guess you have any idea about this? I still haven't figured out why it's not working...

jedwards1211 commented 7 years ago

Okay, I figured it all out! Yay!

jedwards1211 commented 7 years ago

@luisherranz now that I put the webpack 2 code in master, could you delete the webpack2 branch? I created a webpack1 branch from the old master.

luisherranz commented 7 years ago

Deleted 👍

Thanks for your contribution @jedwards1211!