Skip to content

Instantly share code, notes, and snippets.

@ptmt
Last active August 1, 2017 12:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ptmt/a130f03814eadaf25318c39750b70b3f to your computer and use it in GitHub Desktop.
Save ptmt/a130f03814eadaf25318c39750b70b3f to your computer and use it in GitHub Desktop.
Symlinks workaround with wml
const { execSync, spawn } = require('child_process');
if (process.argv.indexOf('start') > -1) {
console.log('Setting up wml');
const wmlBin = path.join(__dirname, 'node_modules/.bin/wml');
try {
console.log(execSync(`${wmlBin} rm all`).toString());
console.log(
execSync(
`${wmlBin} add ${__dirname}/../module ${__dirname}/node_modules/module --skip-prompt=true`
).toString()
);
console.log(execSync(`watchman watch ${__dirname}/../module`).toString());
const wml = spawn(wmlBin, ['start']);
wml.stdout.on('data', data => {
console.log(`${data}`);
});
wml.stderr.on('data', data => {
console.error(`${data}`);
});
} catch (e) {
console.error(e);
}
}
module.exports = {}
@ptmt
Copy link
Author

ptmt commented Jul 28, 2017

You need a patched version of wml https://github.com/mlabrum/wml#patch-1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment