npx grunt task building outside 'build' directory

npx grunt task building outside 'build' directory

sakib m發表於
Number of replies: 5
Sorry if this question has already been asked ( I could not find however). 

I installed npm dependencies by running on moodle dir:
npm install

I also installed grunt cli as global and npx as well. Commands are working. Everything is fine except when I run 'npx grunt' adm/src/my.js files are being transpiled in same (src) directory. I think it is supposed to that grunt should output .js files inside 'build' directory. 
評比平均分數: -
In reply to sakib m

Re: npx grunt task building outside 'build' directory

sakib m發表於
I tested it on linux/Ubuntu. These commands are working fine. JS modules and are being outputted in 'amd/build' directory. But in windows something is wrong. Minified files are output to amd/src directory.

Windows 11
In reply to sakib m

Re: npx grunt task building outside 'build' directory

sakib m發表於
UPDATE: The current working solution/workaround is, install Ubuntu on windows via WSL (google it if you are unaware of it). Then use ubuntu terminal instead of windows terminal.
In reply to sakib m

Re: npx grunt task building outside 'build' directory

lior gil發表於
Core developers的相片
When running grunt on Windows, a root path has to be declared to ensure that it will only run on the desired directory.
For example: grunt amd --root=mod/quiz/amd/src/