Closed mikemaccana closed 4 years ago
It works for me if I put it in resolve only (I have no options for commonjs and I'm using the API).
Though I have all other kinds of hell after that. Using import export means things that you import that are commonjs get wrapped under a global use strict so basically stuff isn't going to work. To add insult to injury it tries to include things like util but doesn't because of a circular reference, so the built script tries to use util then dies because its not defined.
You could also try with the builtins plugin. However I've had trouble with that as well inserting unused shims that crash.
I personally see it as a lost cause trying to import assert from npm. Instead I have a plugin that imports dynamically based on target and file extension (IE, checking for _backend and _frontend suffixes).
Hey folks (this is a canned reply, but we mean it!). Thanks to everyone who participated in this issue. We're getting ready to move this plugin to a new home at https://github.com/rollup/plugins, and we have to do some spring cleaning of the issues to make that happen. We're going to close this one, but it doesn't mean that it's not still valid.
We've got some time yet before the move while we resolve pending Pull Requests, so if this issue is still relevant, please @ me and I'll make sure it gets reopened and transferred to the new repo. :beer:
I am attempting to use the
assert
module from npm.preferBuiltins: false
has no effect in eitherrollup-plugin-commonjs
orrollup-plugin-node-resolve
.Using the following rollup,config.js
Produces the following error: