Skip to content

Integrating Response with Webpack2 #63

@gonzaloplaza

Description

@gonzaloplaza

Hi Ryan

I'm developing a project using this theme from themeforest (https://themeforest.net/item/kosmo-multi-purpose-responsive-bootstrap-4-admin-template-ui-framework/19506620) wich uses Response.js.

I'm using Webpack2 to generate a unique bundle and can't load Response.js -> I'm getting this error after generating bundle, in console:

Uncaught TypeError: Cannot read property 'jQuery' of undefined

This is the config i've used for webpack2:

new webpack.ProvidePlugin({
      $: "jquery",
      jQuery: 'jquery',
      "window.jQuery": 'jquery',
      "window.$" : "jquery",
      jquery: 'jquery',
      Response: 'response.js',
      "window.Response": "response.js",
      Popper: ['popper.js', 'default'],
      Tether: 'tether',
      'window.Tether': 'tether'
    })

Looks like when Response is being loaded, it doesn't recognize jQuery , this is the exactly line that fails. What is root?

Note: i'm using jQuery 3.2.1

var $ = root['jQuery'] || root['Zepto'] || root['ender'] || root['elo'];

Do you have any idea if something not compatible or i'm doing something wrong?. Thank you in advance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions