Skip to content

UMD generated by rollup not recognized #119

@betabong

Description

@betabong

Rollup is a relatively new module bundler (es6) that can generate UMD style output. Unfortunately the code is not recognized by AMDclean.

It goes like this (after Require Optimizer):

(function(global, factory) {
	typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
	typeof define === 'function' && define.amd ? define(factory) :
	(global.Vue = factory());
})(this, (function() {
  return true;
}))

Live here: http://gregfranko.com/amdclean/?code=(function(global%2C%20factory)%20%7B%0A%09typeof%20exports%20%3D%3D%3D%20'object'%20%26%26%20typeof%20module%20!%3D%3D%20'undefined'%20%3F%20module.exports%20%3D%20factory()%20%3A%0A%09typeof%20define%20%3D%3D%3D%20'function'%20%26%26%20define.amd%20%3F%20define(factory)%20%3A%0A%09(global.Vue%20%3D%20factory())%3B%0A%7D)(this%2C%20(function()%20%7B%0A%20%20return%20true%3B%0A%7D))

amdclean only recognizes if the conditions are put into if-else.

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