javascript - Rollup.js how import a js file (not es6 module) without any change (myvar$extrastring) -
first of all, understand why rollup.js need append string @ end of variable avoid collision but... don't understand how "concat/import" simple javascript file not amd/commonjs/es6, simple revealing module ! i have following file structure: foo.js var foo = (function () { var somemethod = function () {}; return { somemethod: somemethod }; })(); bar.js (function(module) { module.bar = "bar"; })(foo); main.js import "foo.js" import "bar.js" after building, got: build.js var foo$1 = (function () { // here problem var somemethod = function () {}; return { somemethod: somemethod }; })(); (function(module) { module.bar = "bar"; })(foo); // ouupss ! so how can got foo instead of foo$1 ? or foo$1 instead of foo bar.js ? edit: in case, in main.js, use default import in view override default name: import foo "foo.js" i got error (normal !): ...