@jcoreio/toolchain-esnext 3.9.3 → 3.9.4

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/package.json +2 -2
  2. package/plugins/compile.cjs +20 -18
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jcoreio/toolchain-esnext",
3
- "version": "3.9.3",
3
+ "version": "3.9.4",
4
4
  "description": "ESNext JS build toolchain",
5
5
  "repository": {
6
6
  "type": "git",
@@ -32,7 +32,7 @@
32
32
  "fs-extra": "^10.0.0",
33
33
  "resolve": "^1.22.2",
34
34
  "resolve-bin": "^1.0.0",
35
- "@jcoreio/toolchain": "3.9.3"
35
+ "@jcoreio/toolchain": "3.9.4"
36
36
  },
37
37
  "toolchainManaged": {
38
38
  "dependencies": {
@@ -27,24 +27,7 @@ module.exports = [
27
27
  ],
28
28
  { env: { ...process.env, JCOREIO_TOOLCHAIN_CJS: '1' } }
29
29
  )
30
- if (extensions.length) {
31
- for (const ext of ['.js', '.mjs']) {
32
- if (!extensions.includes(ext)) {
33
- const srcFiles = await glob(path.join('**', '*' + ext), {
34
- cwd: path.join(projectDir, 'src'),
35
- })
36
- for (const file of srcFiles) {
37
- // eslint-disable-next-line no-console
38
- console.error(
39
- path.join('src', file),
40
- '->',
41
- path.join('dist', file)
42
- )
43
- await fs.copy(path.join('src', file), path.join('dist', file))
44
- }
45
- }
46
- }
47
- }
30
+
48
31
  const jsFiles = await glob(path.join('dist', '**', '*.js'))
49
32
  if (toolchainConfig.outputEsm !== false) {
50
33
  if (toolchainConfig.esWrapper) {
@@ -79,6 +62,25 @@ module.exports = [
79
62
  )
80
63
  }
81
64
  }
65
+
66
+ if (extensions.length) {
67
+ for (const ext of ['.js', '.mjs']) {
68
+ if (!extensions.includes(ext)) {
69
+ const srcFiles = await glob(path.join('**', '*' + ext), {
70
+ cwd: path.join(projectDir, 'src'),
71
+ })
72
+ for (const file of srcFiles) {
73
+ // eslint-disable-next-line no-console
74
+ console.error(
75
+ path.join('src', file),
76
+ '->',
77
+ path.join('dist', file)
78
+ )
79
+ await fs.copy(path.join('src', file), path.join('dist', file))
80
+ }
81
+ }
82
+ }
83
+ }
82
84
  },
83
85
  { insteadOf: '@jcoreio/toolchain' },
84
86
  ],