Skip to main content
Add Rollup 1.0 quote
Source Link
Jack Steam
  • 5.4k
  • 3
  • 29
  • 42

This is used by bundler tools for ESM (ECMAScript Module) detection. The Rollup documentation says it pretty well:

If your package.json file also has a module field, ES6-aware tools like Rollup and webpack 2 will import the ES6 module version directly.

This article on Rollup 1.0 says it another way:

The main field makes sure that Node users using require will be served the UMD version. The module field is not an official npm feature but a common convention among bundlers to designate how to import an ESM version of our library.

Further discussion of pkg.module is on the Rollup Github Wiki and the webpack Docs.

This is used by bundler tools for ESM (ECMAScript Module) detection. The Rollup documentation says it pretty well:

If your package.json file also has a module field, ES6-aware tools like Rollup and webpack 2 will import the ES6 module version directly.

Further discussion of pkg.module is on the Rollup Github Wiki and the webpack Docs.

This is used by bundler tools for ESM (ECMAScript Module) detection. The Rollup documentation says it pretty well:

If your package.json file also has a module field, ES6-aware tools like Rollup and webpack 2 will import the ES6 module version directly.

This article on Rollup 1.0 says it another way:

The main field makes sure that Node users using require will be served the UMD version. The module field is not an official npm feature but a common convention among bundlers to designate how to import an ESM version of our library.

Further discussion of pkg.module is on the Rollup Github Wiki and the webpack Docs.

Add webpack link
Source Link
Jack Steam
  • 5.4k
  • 3
  • 29
  • 42

This is used by bundler tools for ESM (ECMAScript Module) detection. The Rollup documentation says it pretty well:

If your package.json file also has a module field, ES6-aware tools like Rollup and webpack 2 will import the ES6 module version directly.

Further discussion of pkg.module is on the Rollup Github Wiki and the webpack Docs.

This is used by bundler tools for ESM (ECMAScript Module) detection. The Rollup documentation says it pretty well:

If your package.json file also has a module field, ES6-aware tools like Rollup and webpack 2 will import the ES6 module version directly.

Further discussion of pkg.module is on the Rollup Github Wiki.

This is used by bundler tools for ESM (ECMAScript Module) detection. The Rollup documentation says it pretty well:

If your package.json file also has a module field, ES6-aware tools like Rollup and webpack 2 will import the ES6 module version directly.

Further discussion of pkg.module is on the Rollup Github Wiki and the webpack Docs.

Source Link
Jack Steam
  • 5.4k
  • 3
  • 29
  • 42

This is used by bundler tools for ESM (ECMAScript Module) detection. The Rollup documentation says it pretty well:

If your package.json file also has a module field, ES6-aware tools like Rollup and webpack 2 will import the ES6 module version directly.

Further discussion of pkg.module is on the Rollup Github Wiki.