Skip to content

Instantly share code, notes, and snippets.

@ptmt
Last active Aug 1, 2017
Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner Author

@ptmt 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