Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
test-module
console.log('Loaded test-module via pkg.browser');
export function logModule() {
console.log('`logModule` called in test-module');
}
export function totallyUnused() {
console.log('I go totally unused!');
}
console.log('Loaded test-module via pkg.browser');
function logModule() {
console.log('`logModule` called in test-module');
}
function totallyUnused() {
console.log('I go totally unused!');
}
exports.logModule = logModule;
exports.totallyUnused = totallyUnused;
console.log('Loaded test-module via pkg.module');
export function logModule() {
console.log('`logModule` called in test-module');
}
export function totallyUnused() {
console.log('I go totally unused!');
}
console.log('Loaded test-module via pkg.main');
function logModule() {
console.log('`logModule` called in test-module');
}
function totallyUnused() {
console.log('I go totally unused!');
}
exports.logModule = logModule;
exports.totallyUnused = totallyUnused;
{
"name": "test-module",
"version": "1.0.0",
"description": "A test module exporting a `pkg.module`, `pkg.browser`, and `pkg.main`",
"author": "Josh Crowther <jshcrowthe@gmail.com>",
"license": "MIT",
"main": "index.js",
"browser": {
"index.js": "index.browser.js",
"index.esm.js": "index.browser.esm.js",
"module": "index.esm.js",
"jsnext:main": "dist/index.esm.js"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment