vite-plugin-esmodule
Advanced tools
Comparing version
{ | ||
"name": "vite-plugin-esmodule", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "Build ES module to CommonJs module for Node.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -36,9 +36,8 @@ # vite-plugin-esmodule | ||
// this means that you have explicit specified the entry file | ||
// the purpose of this design is to smooth out the difference between Vite and Webpack | ||
// 🌱 the purpose of this design is to smooth out the difference between Vite and Webpack | ||
{ 'file-type': 'file-type/index.js' }, | ||
// when setting `target: 'node'` in Webpack, it always takes `exports.node` as the entry | ||
// in other words, using 'filt-type' string can also work normally | ||
// but Vite always gives priority to `exports.browser` as the entry | ||
{ 'file-type': 'file-type/index.js' }, | ||
// it can work normally when using Webpack | ||
// 🙉 it can work normally when using Webpack | ||
// 'filt-type', | ||
@@ -45,0 +44,0 @@ ]), |
@@ -36,9 +36,8 @@ # vite-plugin-esmodule | ||
// 这里表示你可以显示的指定你要以哪个文件作为入口 | ||
// 这样设计的目的是为了抹平 Vite 和 Webpack 之间的差异 | ||
// 🌱 这样设计的目的是为了抹平 Vite 和 Webpack 之间的差异 | ||
{ 'file-type': 'file-type/index.js' }, | ||
// 当使用 Webpack 并设置了 target: 'node' 的时候,Webpack 会自动以 exports.node 为入口 | ||
// 也就是说这里使用 'filt-type' 字符串也是可行的 | ||
// 但是 Vite 总是优先使用 exports.browser 字段作为入口 | ||
{ 'file-type': 'file-type/index.js' }, | ||
// 在 Webpack 下这样写也可行 | ||
// 🙉 在 Webpack 下这样写也可行 | ||
// 'filt-type', | ||
@@ -45,0 +44,0 @@ ]), |
11387
0.16%101
-0.98%