Skip to content

Script magento-plugin.js can not be using like global variable in JS. #97

@sgeleon

Description

@sgeleon

Problem:

Script magento-plugin.js can not be using like global variable in JS.

Solution:

We should add option 'library' according documentation

https://webpack.js.org/configuration/output/#librarytarget-umd

module.exports = {
  //...
  output: {
    library: 'MyLibrary',
    libraryTarget: 'umd',
  },
};

because script magento-plugin.js () can be using like a global variable.

import {PageManager, MutationManager} from '@addressfinder/addressfinder-webpage-tools'

export **default class MagentoPlugin** {
  constructor(widgetConfig, formsConfig) {
    ...
 }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions