You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/docs/src/dist-files.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ Inside `dist` you should see files like these:
22
22
📄 my-lib.cjs
23
23
📄 my-lib.css
24
24
📄 my-lib.d.ts
25
-
📄 my-lib.esm.dev.js
25
+
📄 my-lib.esm.dev.mjs
26
26
📄 my-lib.esm-browser.prod.js
27
27
📄 my-lib.esm-bundler.prod.mjs
28
28
📄 my-lib.global.dev.js
@@ -101,7 +101,7 @@ This file contains the TypeScript types. This should include type information fo
101
101
102
102
Tooling in the consuming application should pick this up automatically, as it's referenced from `package.json`.
103
103
104
-
### `<name>.esm.dev.js`
104
+
### `<name>.esm.dev.mjs`
105
105
106
106
This file exposes the library as an ES module. It is intended to be used during development, either with a bundler or directly in the browser via `<script type="module">` and import maps.
107
107
@@ -140,7 +140,7 @@ Some features of this build:
140
140
- The global `__DEV__` flag will be set to `false` and dead code removed. This is only relevant if you're using it in your code.
141
141
- SFCs will be compiled in production mode.
142
142
143
-
During development, you'd normally use `<name>.esm.dev.js` instead.
143
+
During development, you'd normally use `<name>.esm.dev.mjs` instead.
144
144
145
145
### `<name>.esm-bundler.prod.mjs`
146
146
@@ -151,7 +151,7 @@ Some features of this build:
151
151
- The global `__DEV__` variable will depend on the bundler's value for `process.env.NODE_ENV`.
152
152
- SFCs will be compiled in production mode.
153
153
154
-
From a bundler's perspective, the only significant difference between this build and the `<name>.esm.dev.js` build is that `.vue` files are built in production mode. If you aren't using `.vue` files in your library code then this file can be used in both development and production. That would be similar to libraries like Vue core, Vue Router and Pinia, which just have an `esm-bundler` build, with no distinction between `dev` and `prod`. In that scenario, `<name>.esm.dev.js` is only used in the browser, so it could be renamed to something like `<name>.esm-browser.dev.js`.
154
+
From a bundler's perspective, the only significant difference between this build and the `<name>.esm.dev.mjs` build is that `.vue` files are built in production mode. If you aren't using `.vue` files in your library code then this file can be used in both development and production. That would be similar to libraries like Vue core, Vue Router and Pinia, which just have an `esm-bundler` build, with no distinction between `dev` and `prod`. In that scenario, `<name>.esm.dev.mjs` is only used in the browser, so it could be renamed to something like `<name>.esm-browser.dev.js`.
155
155
156
156
### `<name>.global.dev.js` and `<name>.global.prod.js`
157
157
@@ -194,7 +194,7 @@ A single Vite build can produce multiple files, but those files must share most
194
194
There's nothing special about having 3 builds, that's just how many we need to create the combinations we need. We generate 3 `esm` files in `dist`, so we need at least 3 builds to achieve that.
195
195
196
196
Roughly speaking:
197
-
-`build:dev` - unminified development builds that can be served to the browser without further build tools: `<name>.esm.dev.js` and `<name>.global.dev.js`.
197
+
-`build:dev` - unminified development builds that can be served to the browser without further build tools: `<name>.esm.dev.mjs` and `<name>.global.dev.js`.
198
198
-`build:neutral` - unminified builds that won't go directly to the browser: `<name>.cjs` and `<name>.esm-bundler.prod.js`.
199
199
-`build:prod` - minified production builds to be served directly to the browser: `<name>.esm.prod.js` and `<name>.global.prod.js`
0 commit comments