webpack-contrib/expose-loader

[Bug] Setup via `webpack.config.js` file not working

luaz opened this issue · 4 comments

luaz commented

I am trying to expose jquery to be accessible via $ on external HTML/Browser Console.

The following works:
require("expose-loader?$!jquery");

This doesn't work:

  module: {
    rules: [
      {
        test: require.resolve('jquery'),
        // test: path.resolve(__dirname, 'src/js/jquery.js'),
        // test: "jquery",
        // test: /jquery\.js$/,
        use: [{
            loader: 'expose-loader',
            options: '$'
        }]
      }
    ],
  },

I was wondering did I configure it wrongly.

expose-loader: 0.7.3
webpack: 3.5.1
node: 6.11.2

Same problem

@luaz @airwave-development can you provide a reproduction?
I've created a simple version with the setup and it works just fine.

Also this issue duplicates #20

Duplicate of #20