nuxt-mail 3.1.28 → 3.1.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +8 -1
  2. package/package.json +9 -5
package/dist/index.js CHANGED
@@ -6,10 +6,17 @@ import nodemailer from 'nodemailer';
6
6
  import nuxtPushPlugins from 'nuxt-push-plugins';
7
7
  import parsePackagejsonName from 'parse-packagejson-name';
8
8
  import P from 'path';
9
+ import { pathToFileURL } from 'url';
9
10
  import send from "./send.js";
10
11
  const resolver = createResolver(import.meta.url);
11
12
  const packageConfig = fs.readJsonSync(resolver.resolve('../package.json'));
12
13
  const moduleName = parsePackagejsonName(packageConfig.name).fullName;
14
+ const getAliasPath = nuxt => {
15
+ if (process.env.NODE_ENV === 'development') {
16
+ return pathToFileURL(P.resolve(nuxt.options.buildDir, moduleName)).href;
17
+ }
18
+ return P.resolve(nuxt.options.buildDir, moduleName);
19
+ };
13
20
  export default function (moduleOptions, nuxt) {
14
21
  nuxt = nuxt || this;
15
22
  const options = {
@@ -45,7 +52,7 @@ export default function (moduleOptions, nuxt) {
45
52
  getContents: () => fs.readFile(resolver.resolve('./send.js'), 'utf8'),
46
53
  write: true
47
54
  });
48
- nuxt.options.alias['#mail'] = P.resolve(nuxt.options.buildDir, moduleName);
55
+ nuxt.options.alias['#mail'] = getAliasPath(nuxt);
49
56
  addServerHandler({
50
57
  handler: resolver.resolve('./server-handler.post.js'),
51
58
  route: '/mail/send'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-mail",
3
- "version": "3.1.28",
3
+ "version": "3.1.29",
4
4
  "description": "Adds email sending capability to a Nuxt.js app. Adds a server route, an injected variable, and uses nodemailer to send emails.",
5
5
  "keywords": [
6
6
  "email",
@@ -52,13 +52,17 @@
52
52
  "devDependencies": {
53
53
  "@dword-design/base": "^9.1.9",
54
54
  "@dword-design/puppeteer": "^5.0.0",
55
- "@dword-design/tester": "^2.0.0",
56
- "@dword-design/tester-plugin-nuxt-config": "^1.1.3",
57
- "@dword-design/tester-plugin-puppeteer": "^2.1.22",
58
55
  "@nuxtjs/axios": "^5.13.1",
59
56
  "axios": "^0.27.2",
60
57
  "depcheck-package-name": "^2.0.0",
61
- "smtp-tester": "^2.0.1"
58
+ "execa": "^7.1.1",
59
+ "nuxt": "^3.3.3",
60
+ "ora": "^6.3.0",
61
+ "output-files": "^2.0.19",
62
+ "port-ready": "^0.1.0",
63
+ "smtp-tester": "^2.0.1",
64
+ "tree-kill-promise": "^3.0.9",
65
+ "with-local-tmp-dir": "^5.0.0"
62
66
  },
63
67
  "engines": {
64
68
  "node": ">=14"