diff --git a/packages/vant-touch-emulator/build.js b/packages/vant-touch-emulator/build.js new file mode 100644 index 000000000..f28813b81 --- /dev/null +++ b/packages/vant-touch-emulator/build.js @@ -0,0 +1,11 @@ +const fs = require('fs'); +const path = require('path'); + +const srcFile = path.join(__dirname, 'src', 'index.js'); +const distDir = path.join(__dirname, 'dist'); + +if (!fs.existsSync(distDir)) { + fs.mkdirSync(distDir); +} +fs.copyFileSync(srcFile, path.join(distDir, 'index.js')); +fs.copyFileSync(srcFile, path.join(distDir, 'index.mjs')); diff --git a/packages/vant-touch-emulator/changelog.md b/packages/vant-touch-emulator/changelog.md index 69d213800..d112a9e04 100644 --- a/packages/vant-touch-emulator/changelog.md +++ b/packages/vant-touch-emulator/changelog.md @@ -1,5 +1,11 @@ # Changelog +### [v1.4.0] + +`2022-08-06` + +- support `.mjs` extension + ### [v1.3.1] `2021-07-06` diff --git a/packages/vant-touch-emulator/package.json b/packages/vant-touch-emulator/package.json index e4cc08e51..0c1b6a406 100644 --- a/packages/vant-touch-emulator/package.json +++ b/packages/vant-touch-emulator/package.json @@ -1,10 +1,16 @@ { "name": "@vant/touch-emulator", - "version": "1.3.2", + "version": "1.4.0", "description": "Vant touch emulator", - "main": "index.js", + "main": "dist/index.js", + "module": "dist/index.mjs", + "scripts": { + "build": "node ./build.js", + "prepare": "pnpm build" + }, "publishConfig": { - "access": "public" + "access": "public", + "registry": "https://registry.npmjs.org/" }, "repository": { "type": "git", diff --git a/packages/vant-touch-emulator/index.js b/packages/vant-touch-emulator/src/index.js similarity index 100% rename from packages/vant-touch-emulator/index.js rename to packages/vant-touch-emulator/src/index.js