Conditional Exports ã¨ã¯ package.json å ã® exports ãã£ã¼ã«ãã«ã¯, 以ä¸ã®ããã«æ¡ä»¶ä»ãã§ã¨ã¯ã¹ãã¼ããããã¡ã¤ã«ãæå®ã§ãã (conditional exports). { "name": "@susisu/example", "type": "module", "exports": { ".": { "require": "./lib/index.cjs", "default": "./lib/index.js" } } } ãã¨ãã°ãã®ä¾ã§ã¯ CommonJS ãã¡ã¤ã«å ãã require("@susisu/example") ã®ããã«åç §ããå ´å㯠require ã«æå®ããã ./lib/index.cjs ã, ESM ã®ãã¡ã¤ã«å ãã import "@susisu/example" ã®ããã«åç §ããå ´å㯠default ã«æ
{{#tags}}- {{label}}
{{/tags}}