Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Grunt Task RequireJS

sameer boddunApr 3 2017 — edited Apr 6 2017

I have created starter project using Nav drawer template. I used yeoman to create  it.

I am trying to optimize Javascript files using requirejs optimizer. but the optimizer is failing with all the changes I am doing in oraclejet-build.js file.

I have made following change in the oraclejet-build.js file

requireJs: {

      baseUrl: './web/',

      name: './js/main.js',

      mainConfigFile: './js/main.js',

      out: './web/js/main.final.js'

}

I am running

grunt build:release

task but I am getting  following error

Error: Error: ERROR: module path does not exist: ./js/main.js for module named: ./js/main.js. Path is relative to: C:/sources/demo1/ojet

I tried the other possible values for baseUser and name, but I am still getting same error.

    requireJs: {

      baseUrl: '.',

      name: 'web/js/main.js',

      mainConfigFile: 'web/js/main.js',

      //optimize: 'option for optimize',

      out: 'web/js/main.final.js'

    },

With these values also i get following error

errno: -4058,     

code: 'ENOENT',     

syscall: 'open',     

path: 'C:\\sources\\demo1\\ojet\\libs\\oj\\v3.0.0\\min\\ojcore.js',     

fileName: 'C:/sources/demo1/ojet/libs/oj/v3.0.0/min/ojcore.js',     

moduleTree: [ 'web/js/main.js' ] } } >>

Error: Error: ENOENT: no such file or directory, open 'C:\sources\demo1\ojet\libs\oj\v3.0.0\min\ojcore.js' >>

In module tree: >>    

      web/js/main.js

I have tried with some other values also I am still getting some or other error. Can anyone please help with the sample config for RequireJS section. I am not using libraries other than what comes with the starter template. I have no other customization done on the oraclejet-build.js files. RequireJS section is the only change that I have.

Message was edited by: sameerbo

This post has been answered by 2738986 on Apr 5 2017
Jump to Answer
Comments
Post Details
Added on Apr 3 2017
7 comments
928 views