diff --git a/packages/embark/.babelrc.js b/packages/embark/.babelrc.js index 2b0ab4172..c4f988159 100644 --- a/packages/embark/.babelrc.js +++ b/packages/embark/.babelrc.js @@ -3,7 +3,7 @@ const cloneDeep = require('lodash.clonedeep'); const {copySync, ensureDirSync} = require('fs-extra'); const glob = require('glob'); -const {dirname, join, relative} = require('path'); +const {dirname, join, normalize, relative, sep} = require('path'); // @babel/cli v7's --copy-files option does not work well together with // config-specified ignore paths, and that's a problem for embark-collective @@ -27,9 +27,9 @@ function copyFiles (ignored) { ]} ).map(path => relative(__dirname, path)); - ignored = ignored.concat(others); + ignored = ignored.concat(others).map(normalize); ignored - .map(path => path.replace('src/', 'dist/')) + .map(path => path.replace(`src${sep}`, `dist${sep}`)) .forEach((dest, index) => { ensureDirSync(dirname(join(__dirname, dest))); const source = ignored[index]; diff --git a/packages/plugins/scaffolding/.babelrc.js b/packages/plugins/scaffolding/.babelrc.js index f85097a2e..3d8dcd225 100644 --- a/packages/plugins/scaffolding/.babelrc.js +++ b/packages/plugins/scaffolding/.babelrc.js @@ -3,7 +3,7 @@ const cloneDeep = require('lodash.clonedeep'); const {copySync, ensureDirSync} = require('fs-extra'); const glob = require('glob'); -const {dirname, join, relative} = require('path'); +const {dirname, join, normalize, relative, sep} = require('path'); // @babel/cli v7's --copy-files option does not work well together with // config-specified ignore paths, and that's a problem for embark-collective @@ -25,9 +25,9 @@ function copyFiles (ignored) { ]} ).map(path => relative(__dirname, path)); - ignored = ignored.concat(others); + ignored = ignored.concat(others).map(normalize); ignored - .map(path => path.replace('src/', 'dist/')) + .map(path => path.replace(`src${sep}`, `dist${sep}`)) .forEach((dest, index) => { ensureDirSync(dirname(join(__dirname, dest))); const source = ignored[index]; diff --git a/packages/plugins/web3/.babelrc.js b/packages/plugins/web3/.babelrc.js index 71fe1c0f7..9b4db7c0f 100644 --- a/packages/plugins/web3/.babelrc.js +++ b/packages/plugins/web3/.babelrc.js @@ -3,7 +3,7 @@ const cloneDeep = require('lodash.clonedeep'); const {copySync, ensureDirSync} = require('fs-extra'); const glob = require('glob'); -const {dirname, join, relative} = require('path'); +const {dirname, join, normalize, relative, sep} = require('path'); // @babel/cli v7's --copy-files option does not work well together with // config-specified ignore paths, and that's a problem for embark-collective @@ -25,9 +25,9 @@ function copyFiles (ignored) { ]} ).map(path => relative(__dirname, path)); - ignored = ignored.concat(others); + ignored = ignored.concat(others).map(normalize); ignored - .map(path => path.replace('src/', 'dist/')) + .map(path => path.replace(`src${sep}`, `dist${sep}`)) .forEach((dest, index) => { ensureDirSync(dirname(join(__dirname, dest))); const source = ignored[index]; diff --git a/packages/stack/webserver/.babelrc.js b/packages/stack/webserver/.babelrc.js index 71fe1c0f7..9b4db7c0f 100644 --- a/packages/stack/webserver/.babelrc.js +++ b/packages/stack/webserver/.babelrc.js @@ -3,7 +3,7 @@ const cloneDeep = require('lodash.clonedeep'); const {copySync, ensureDirSync} = require('fs-extra'); const glob = require('glob'); -const {dirname, join, relative} = require('path'); +const {dirname, join, normalize, relative, sep} = require('path'); // @babel/cli v7's --copy-files option does not work well together with // config-specified ignore paths, and that's a problem for embark-collective @@ -25,9 +25,9 @@ function copyFiles (ignored) { ]} ).map(path => relative(__dirname, path)); - ignored = ignored.concat(others); + ignored = ignored.concat(others).map(normalize); ignored - .map(path => path.replace('src/', 'dist/')) + .map(path => path.replace(`src${sep}`, `dist${sep}`)) .forEach((dest, index) => { ensureDirSync(dirname(join(__dirname, dest))); const source = ignored[index]; diff --git a/packages/utils/solo/index.js b/packages/utils/solo/index.js index ed95f48f7..75954f822 100644 --- a/packages/utils/solo/index.js +++ b/packages/utils/solo/index.js @@ -24,6 +24,7 @@ module.exports = function (cliArgs) { join(embarkCollectivePath, 'package.json') ); + const npxCmd = process.platform === 'win32' ? 'npx.cmd': 'npx'; process.chdir(embarkCollectivePath); - spawn('npm', ['run', '--', ...cliArgs], {stdio: 'inherit'}); + spawn(npxCmd, ['run', '--', ...cliArgs], {stdio: 'inherit'}); };