rollup / rollup-plugin-node-resolve

This module has moved and is now available at @rollup/plugin-node-resolve / https://github.com/rollup/plugins/blob/master/packages/node-resolve
MIT License
469 stars 96 forks source link

Unresolved dependencies #205

Closed txs1992 closed 5 years ago

txs1992 commented 5 years ago

The version of rollup-plugin-node-resolve I am using is 4.2.1. I want my repository to be compatible with some lower-level browsers, so I used babel's core-js. But the result of the package is not polyfill, but is loaded by require or define. If you don't have these two methods, you will get an error.

This is the result of my packaging.

;(function(global, factory) {
  typeof exports === 'object' && typeof module !== 'undefined'
    ? (module.exports = factory(require('core-js/modules/es.array.includes')))
    : typeof define === 'function' && define.amd
    ? define(['core-js/modules/es.array.includes'], factory)
    : ((global = global || self), (global.MtUtils = factory()))
})(this, function() {
  'use strict'
  ...
})

I hope that these files should be included in my packaged files instead of being introduced again.