Skip to content

Instantly share code, notes, and snippets.

@anandthakker
Last active July 23, 2019 14:34
Show Gist options
  • Save anandthakker/db15280ebaa8a0b1434d692385d7a3bb to your computer and use it in GitHub Desktop.
Save anandthakker/db15280ebaa8a0b1434d692385d7a3bb to your computer and use it in GitHub Desktop.
define(["require", "exports", "tslib", "lib/animation-frame", "jquery"], function (require, exports, tslib_1, AnimationFrame, $) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.testFixture = {};
function checkAllWatchingDetectors() {
console.log('foo');
}
exports.checkAllWatchingDetectors = checkAllWatchingDetectors;
var DOMChangeDetector = /** @class */ (function () {
function DOMChangeDetector(elt, cb) {
console.log('foo');
}
DOMChangeDetector.prototype.stopWatching = function () {
delete this.watchingDetectors[this.id];
};
return DOMChangeDetector;
}());
exports.default = DOMChangeDetector;
});
import 'tslib';
import 'lib/animation-frame';
import 'jquery';
var DOMChangeDetector = (function () {
function DOMChangeDetector(elt, cb) {
console.log("foo");
}
DOMChangeDetector.prototype.stopWatching = function () {
delete this.watchingDetectors[this.id];
};
return DOMChangeDetector;
})();
var c = DOMChangeDetector;
new c();
define(['require'], function (require) {
const DOMChangeDetector = require('./amdmodule.js');
new DOMChangeDetector();
})
{
"name": "rollup",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"@buxlabs/amd-to-es6": "^0.13.3",
"module-lookup-amd": "^6.2.0",
"rollup": "^1.17.0",
"rollup-plugin-amd": "^4.0.0",
"rollup-plugin-postcss": "^2.0.3",
"rollup-plugin-typescript": "^1.0.1"
}
}
export default {
baseUrl: '.',
waitSeconds: 0,
paths: {
}
}
import amd from 'rollup-plugin-amd';
import lookup from 'module-lookup-amd';
import config from './require-config';
export default {
input: 'index.js',
output: {
file: 'bundle.js',
format: 'es'
},
plugins: [
//ts(),
// resolveRequireJSPaths(),
// coffee(),
amd({
rewire: function(moduleId, parentPath) {
var lookupResult = lookup({
partial: moduleId,
filename: parentPath,
config: config,
directory: __dirname
});
if (lookupResult.endsWith('.d.ts')) {
lookupResult = lookupResult.replace('.d.ts', '.js');
}
console.log('lookup result: ', lookupResult);
return lookupResult;
}
})
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment