Comparing version 1.0.1 to 1.0.3
{ | ||
"name": "esmify", | ||
"version": "1.0.1", | ||
"version": "1.0.3", | ||
"description": "parse and handle import/export for browserify", | ||
@@ -29,3 +29,4 @@ "main": "./esmify.js", | ||
"loud-rejection": "^1.6.0", | ||
"tape": "^4.9.1" | ||
"tape": "^4.9.1", | ||
"wcag-contrast": "1.2.0" | ||
}, | ||
@@ -32,0 +33,0 @@ "scripts": { |
# esmify | ||
A dead-simple tool to add `import` / `export` ES Module syntax for [browserify](https://www.npmjs.com/package/browserify). | ||
A dead-simple tool to add `import` / `export` ES Module syntax to your [browserify](https://www.npmjs.com/package/browserify) builds. | ||
This plugin does the following to your bundler: | ||
The plugin makes the following changes to your bundler: | ||
- Adds `.mjs` extension to module resolution | ||
- Resolves to `"module"` field when `"browser"` field is not defined | ||
- Adds `.mjs` extension to module resolution (which take precedence over `.js` files) | ||
- Resolves to `"module"` field in `package.json` when a `"browser"` field is not specified | ||
- Transforms ES Module syntax (static `import` / `export` statements) into CommonJS | ||
Here's how you use it: | ||
Use it with the `--plugin` or `-p` flags in browserify: | ||
@@ -17,3 +17,3 @@ ```js | ||
Also works with [budo](https://www.npmjs.com/package/budo), for example: | ||
Also works with [budo](https://www.npmjs.com/package/budo) and similar tools, for example: | ||
@@ -24,3 +24,3 @@ ```js | ||
The plugin ignores dynamic import expressions and skips files that don't include `import` / `export` expressions to maintain performance. It runs across your bundle (including `node_modules`) as one of the goals is to support ESM syntax that is beginning to appear in the wild in many npm modules. | ||
Files that don't contain `import` / `export` syntax are ignored, as are dynamic import expressions. The plugin runs across your bundle (including `node_modules`) in order to support ESM-authored modules on npm. | ||
@@ -54,8 +54,6 @@ ## Install | ||
## How it Works | ||
Under the hood, this uses Babel and `plugin-transform-modules-commonjs` to provide robust inter-op that handles a variety of use cases. | ||
Under the hood, this is using Babel with a couple plugins specific to CommonJS/import/export. | ||
## License | ||
MIT, see [LICENSE.md](http://github.com/mattdesl/esmify/blob/master/LICENSE.md) for details. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10758
8
57