├── .gitignore ├── .npmignore ├── LICENSE.md ├── README.md ├── esmify.js ├── package.json ├── resolve.js ├── test ├── fixtures │ ├── esm-module │ │ ├── index.js │ │ ├── index.mjs │ │ └── package.json │ ├── export-default-object.js │ ├── export-default-object.mjs │ ├── export-default.js │ ├── export-named.js │ ├── import-builtin.js │ ├── import-contrast.js │ ├── import-default.js │ ├── import-dynamic.js │ ├── import-esm-with-cjs.js │ ├── import-esm.js │ ├── import-json.js │ ├── import-named.js │ ├── import-pkg-field.js │ ├── import-wildcard.js │ ├── import-with-brfs.js │ ├── import-with-glslify-2.js │ ├── import-with-glslify.js │ ├── no-import-with-syntax.js │ ├── pkg-fields-missing-browser │ │ ├── main.js │ │ ├── module.mjs │ │ └── package.json │ ├── pkg-fields-missing-module │ │ ├── browser.js │ │ ├── main.js │ │ └── package.json │ ├── pkg-fields │ │ ├── browser.js │ │ ├── main.js │ │ ├── module.mjs │ │ └── package.json │ ├── require-contrast.js │ ├── shader.vert │ ├── test.json │ └── vanilla.js ├── test-plugin.js ├── test-resolve.js ├── test-syntax.js └── test-transform.js └── transform.js /.gitignore: -------------------------------------------------------------------------------- 1 | bower_components 2 | node_modules 3 | *.log 4 | .DS_Store 5 | bundle.js 6 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattdesl/esmify/HEAD/.npmignore -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattdesl/esmify/HEAD/LICENSE.md -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattdesl/esmify/HEAD/README.md -------------------------------------------------------------------------------- /esmify.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattdesl/esmify/HEAD/esmify.js -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattdesl/esmify/HEAD/package.json -------------------------------------------------------------------------------- /resolve.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattdesl/esmify/HEAD/resolve.js -------------------------------------------------------------------------------- /test/fixtures/esm-module/index.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattdesl/esmify/HEAD/test/fixtures/esm-module/index.js -------------------------------------------------------------------------------- /test/fixtures/esm-module/index.mjs: -------------------------------------------------------------------------------- 1 | export function test () { 2 | return 'hello'; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/esm-module/package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattdesl/esmify/HEAD/test/fixtures/esm-module/package.json -------------------------------------------------------------------------------- /test/fixtures/export-default-object.js: -------------------------------------------------------------------------------- 1 | console.log('invalid'); 2 | -------------------------------------------------------------------------------- /test/fixtures/export-default-object.mjs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattdesl/esmify/HEAD/test/fixtures/export-default-object.mjs -------------------------------------------------------------------------------- /test/fixtures/export-default.js: -------------------------------------------------------------------------------- 1 | export default function () { 2 | return 'foo'; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/export-named.js: -------------------------------------------------------------------------------- 1 | export function foobar () { 2 | return 'baz'; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/import-builtin.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattdesl/esmify/HEAD/test/fixtures/import-builtin.js -------------------------------------------------------------------------------- /test/fixtures/import-contrast.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattdesl/esmify/HEAD/test/fixtures/import-contrast.js -------------------------------------------------------------------------------- /test/fixtures/import-default.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattdesl/esmify/HEAD/test/fixtures/import-default.js -------------------------------------------------------------------------------- /test/fixtures/import-dynamic.js: -------------------------------------------------------------------------------- 1 | // This is a URL from root of module 2 | import('./test/fixtures/vanilla.js'); 3 | -------------------------------------------------------------------------------- /test/fixtures/import-esm-with-cjs.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattdesl/esmify/HEAD/test/fixtures/import-esm-with-cjs.js -------------------------------------------------------------------------------- /test/fixtures/import-esm.js: -------------------------------------------------------------------------------- 1 | import { test } from './esm-module'; 2 | console.log(test()); 3 | -------------------------------------------------------------------------------- /test/fixtures/import-json.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattdesl/esmify/HEAD/test/fixtures/import-json.js -------------------------------------------------------------------------------- /test/fixtures/import-named.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattdesl/esmify/HEAD/test/fixtures/import-named.js -------------------------------------------------------------------------------- /test/fixtures/import-pkg-field.js: -------------------------------------------------------------------------------- 1 | import { test } from './pkg-fields'; 2 | console.log(test()); 3 | -------------------------------------------------------------------------------- /test/fixtures/import-wildcard.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattdesl/esmify/HEAD/test/fixtures/import-wildcard.js -------------------------------------------------------------------------------- /test/fixtures/import-with-brfs.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattdesl/esmify/HEAD/test/fixtures/import-with-brfs.js -------------------------------------------------------------------------------- /test/fixtures/import-with-glslify-2.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattdesl/esmify/HEAD/test/fixtures/import-with-glslify-2.js -------------------------------------------------------------------------------- /test/fixtures/import-with-glslify.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattdesl/esmify/HEAD/test/fixtures/import-with-glslify.js -------------------------------------------------------------------------------- /test/fixtures/no-import-with-syntax.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattdesl/esmify/HEAD/test/fixtures/no-import-with-syntax.js -------------------------------------------------------------------------------- /test/fixtures/pkg-fields-missing-browser/main.js: -------------------------------------------------------------------------------- 1 | export function test () { 2 | return 'hello main'; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/pkg-fields-missing-browser/module.mjs: -------------------------------------------------------------------------------- 1 | export function test () { 2 | return 'hello mjs'; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/pkg-fields-missing-browser/package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattdesl/esmify/HEAD/test/fixtures/pkg-fields-missing-browser/package.json -------------------------------------------------------------------------------- /test/fixtures/pkg-fields-missing-module/browser.js: -------------------------------------------------------------------------------- 1 | export function test () { 2 | return 'hello browser'; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/pkg-fields-missing-module/main.js: -------------------------------------------------------------------------------- 1 | export function test () { 2 | return 'hello main'; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/pkg-fields-missing-module/package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattdesl/esmify/HEAD/test/fixtures/pkg-fields-missing-module/package.json -------------------------------------------------------------------------------- /test/fixtures/pkg-fields/browser.js: -------------------------------------------------------------------------------- 1 | export function test () { 2 | return 'hello browser'; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/pkg-fields/main.js: -------------------------------------------------------------------------------- 1 | export function test () { 2 | return 'hello main'; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/pkg-fields/module.mjs: -------------------------------------------------------------------------------- 1 | export function test () { 2 | return 'hello mjs'; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/pkg-fields/package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattdesl/esmify/HEAD/test/fixtures/pkg-fields/package.json -------------------------------------------------------------------------------- /test/fixtures/require-contrast.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattdesl/esmify/HEAD/test/fixtures/require-contrast.js -------------------------------------------------------------------------------- /test/fixtures/shader.vert: -------------------------------------------------------------------------------- 1 | void main () { /* test */ } -------------------------------------------------------------------------------- /test/fixtures/test.json: -------------------------------------------------------------------------------- 1 | { 2 | "foo": "bar" 3 | } -------------------------------------------------------------------------------- /test/fixtures/vanilla.js: -------------------------------------------------------------------------------- 1 | console.log('plain old JS'); 2 | -------------------------------------------------------------------------------- /test/test-plugin.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattdesl/esmify/HEAD/test/test-plugin.js -------------------------------------------------------------------------------- /test/test-resolve.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattdesl/esmify/HEAD/test/test-resolve.js -------------------------------------------------------------------------------- /test/test-syntax.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattdesl/esmify/HEAD/test/test-syntax.js -------------------------------------------------------------------------------- /test/test-transform.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattdesl/esmify/HEAD/test/test-transform.js -------------------------------------------------------------------------------- /transform.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattdesl/esmify/HEAD/transform.js --------------------------------------------------------------------------------