You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/07/04 08:28:56 UTC
[GitHub] [cordova-windows] regnete commented on issue #341: WinJS is not
copied when adding windows platform
regnete commented on issue #341: WinJS is not copied when adding windows platform
URL: https://github.com/apache/cordova-windows/issues/341#issuecomment-508391818
Temporarily fix via cordova hook when using unfixed version 7.0.0:
config.xml:
```xml
<platform name="windows">
<hook type="before_prepare" src="hooks/win_winjs_fix.js" />
</platform>
```
hooks/win_winjs_fix.js:
```javascript
const path = require('path');
const shell = require('shelljs');
const fs = require('fs');
module.exports = function (ctx)
{
if (!ctx.opts.platforms.includes('windows'))
return;
return new Promise(function (resolve, reject)
{
const root = ctx.opts.projectRoot;
const projectPath = path.join(root, 'platforms', 'windows');
const destinationDirectory = path.join(projectPath, 'platform_www', 'WinJS', 'js');
const destBaseJsPath = path.join(destinationDirectory, 'base.js');
//var srcBaseJsPath = path.join(root, 'node_modules', 'winjs', 'js', 'base.js');
const srcBaseJsPath = require.resolve('winjs/js/base');
fs.mkdirSync(destinationDirectory, { recursive: true });
shell.cp('-f', srcBaseJsPath, destBaseJsPath);
resolve();
});
};
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org