Skip to content

Commit e0ee2a0

Browse files
committed
v1.5.0
1 parent b0df1c0 commit e0ee2a0

File tree

5 files changed

+22
-8
lines changed

5 files changed

+22
-8
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [2023-05-13] v1.5.0
2+
3+
- b0df1c0 feat: support custom `webpack` version
4+
15
## [2022-10-19] v1.4.4
26

37
- 952da00 v1.4.4

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ When using ES modules(e.g.`node-fetch`) in Node.js/Electron projects, we may nee
1414
## Install
1515

1616
```sh
17-
npm i vite-plugin-esmodule -D
17+
npm i -D vite-plugin-esmodule webpack
1818
```
1919

2020
## Usage

build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const fs = require('fs');
22
const path = require('path');
3-
const libEsm = require('lib-esm');
3+
const libEsm = require('lib-esm').default;
44

55
// const iswatch = process.argv.slice(2).includes('--watch');
66

package.json

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vite-plugin-esmodule",
3-
"version": "1.4.4",
3+
"version": "1.5.0",
44
"description": "Build ES module to CommonJs module for Node.js/Electron",
55
"main": "index.js",
66
"exports": {
@@ -34,13 +34,21 @@
3434
},
3535
"homepage": "https://github.com/vite-plugin/vite-plugin-esmodule#readme",
3636
"dependencies": {
37-
"lib-esm": "~0.3.0",
38-
"vite-plugin-optimizer": "~1.4.2",
39-
"webpack": "^5.74.0"
37+
"lib-esm": "~0.4.0",
38+
"vite-plugin-optimizer": "~1.4.2"
39+
},
40+
"peerDependencies": {
41+
"webpack": "*"
42+
},
43+
"peerDependenciesMeta": {
44+
"webpack": {
45+
"optional": true
46+
}
4047
},
4148
"devDependencies": {
4249
"file-type": "^18.0.0",
43-
"vite": "^3.2.0-beta.2"
50+
"vite": "^4.3.5",
51+
"webpack": "^5.82.1"
4452
},
4553
"files": [
4654
"index.js",

test/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ const vite = require('vite');
88
const esmodule = require('vite-plugin-esmodule');
99
const test = esmodule.__test__;
1010
const moduleName = 'file-type';
11+
12+
const TAG = '[test]';
1113
const node_modules = path.join(__dirname, '../node_modules');
1214
const __snapshots__ = path.join(__dirname, '__snapshots__');
1315

@@ -63,6 +65,6 @@ function runTest() {
6365
child.stdout.on('data', chunk => {
6466
const str = chunk.toString().trim();
6567
assert.equal(str, '[AsyncFunction: fileTypeFromFile]');
66-
console.log('test success');
68+
console.log(TAG, 'index.js passed ✅');
6769
});
6870
}

0 commit comments

Comments
 (0)