From 95fccb8880e175d65ac671e138b0a32efea4b34e Mon Sep 17 00:00:00 2001 From: Labhansh Agrawal Date: Tue, 1 Oct 2019 13:42:06 +0530 Subject: [PATCH] Fix yarn install error --- package.json | 4 ++-- webpack.config.js | 16 ---------------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index f6a14429..87783b17 100644 --- a/package.json +++ b/package.json @@ -12,8 +12,8 @@ "test:unit": "ava test/unit", "test:unit:watch": "yarn run test:unit -- --watch", "prepush": "yarn test", - "postinstall": "electron-builder install-app-deps && yarn run rebuild-node-pty", - "rebuild-node-pty": "electron-rebuild -f -w app/node_modules/node-pty -m app", + "postinstall": "webpack --config-name hyper-app && electron-builder install-app-deps && yarn run rebuild-node-pty && cp -r ./target/node_modules ./app/", + "rebuild-node-pty": "electron-rebuild -f -w target/node_modules/node-pty -m target", "dist": "yarn run build && cross-env BABEL_ENV=production babel --out-file target/renderer/bundle.js --no-comments --minified target/renderer/bundle.js && build", "clean": "node ./bin/rimraf-standalone.js node_modules && node ./bin/rimraf-standalone.js ./app/node_modules && node ./bin/rimraf-standalone.js ./app/renderer" diff --git a/webpack.config.js b/webpack.config.js index c4c9e86f..add61798 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,5 +1,4 @@ const path = require('path'); -const exec = require('child_process').exec; const webpack = require('webpack'); const Copy = require('copy-webpack-plugin'); @@ -49,22 +48,7 @@ module.exports = [ to: './keymaps', flatten: true } - // { - // from: './app/node_modules', // gives really long output in webpack, used cp instead - // to: './node_modules' - // } ]), - - { - apply: compiler => { - compiler.hooks.afterEmit.tap('AfterEmitPlugin', () => { - exec('cp -r ./app/node_modules ./target', (err, stdout, stderr) => { - if (stdout) process.stdout.write(stdout); - if (stderr) process.stderr.write(stderr); - }); - }); - } - }, new ForkTsCheckerWebpackPlugin() ], target: 'electron-main'