Skip to content

A demo of a local file would be good #5

Description

@weotch

I was getting these errors:

friendly-errors 15:42:24  ERROR  Failed to compile with 1 errors
friendly-errors 15:42:24 This relative module was not found:
friendly-errors 15:42:24 
friendly-errors 15:42:24 * ./vendor/polyfills/nodelist-foreach.js in ./.nuxt/nuxt-polyfill/vendor/polyfills/nodelist-foreach.js.js

Until I changed this:

  polyfill: {
    features: [
      {
        require: "vendor/polyfills/nodelist-foreach",
        detect: function() {
          return window.NodeList && !NodeList.prototype.forEach;
        }
      }
    ]
  }

To:

  polyfill: {
    features: [
      {
        require: `${__dirname}/vendor/polyfills/nodelist-foreach`,
        detect: function() {
          return window.NodeList && !NodeList.prototype.forEach;
        }
      }
    ]
  }

Not sure if that's the best way though and an example might help others

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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