13
13
* See the License for the specific language governing permissions and
14
14
* limitations under the License.
15
15
*/
16
-
17
16
/*
18
17
* Dojo build profile for building the loader
19
18
*/
20
19
const nodeRequire = require . rawConfig && require . rawConfig . loaderPatch . nodeRequire || require ;
21
20
const path = nodeRequire ( "path" ) ;
22
21
const fs = nodeRequire ( "fs" ) ;
23
- const version = nodeRequire ( path . resolve ( dojo . baseUrl , "./package.json" ) ) . version ;
22
+
23
+ var profilePath , dojoPath ;
24
+ process . argv . forEach ( ( arg , i ) => {
25
+ if ( arg === '--profile' ) {
26
+ profilePath = process . argv [ i + 1 ] ;
27
+ } else if ( arg === '--dojoPath' ) {
28
+ dojoPath = process . argv [ i + 1 ] ;
29
+ }
30
+ } ) ;
31
+ if ( ! profilePath ) {
32
+ throw new Error ( "--profile command line option not specified" ) ;
33
+ }
34
+ if ( ! dojoPath ) {
35
+ throw new Error ( "--dojoPath command line option not specified" ) ;
36
+ }
37
+
38
+ const version = nodeRequire ( path . resolve ( dojoPath , "../" , "./package.json" ) ) . version ;
24
39
const versionParts = version . split ( "." ) ;
25
40
const majorVersion = parseInt ( versionParts [ 0 ] ) , minorVersion = parseInt ( versionParts [ 1 ] ) , patchVersion = parseInt ( versionParts [ 2 ] ) ;
26
41
if ( majorVersion !== 1 ) {
@@ -33,20 +48,6 @@ const hasInjectApiFix = /* True if the version of Dojo has https://github.com/do
33
48
minorVersion === 10 && patchVersion >= 9 ;
34
49
35
50
var profile = ( ( ) => {
36
- var profilePath , dojoPath ;
37
- process . argv . forEach ( ( arg , i ) => {
38
- if ( arg === '--profile' ) {
39
- profilePath = process . argv [ i + 1 ] ;
40
- } else if ( arg === '--dojoPath' ) {
41
- dojoPath = process . argv [ i + 1 ] ;
42
- }
43
- } ) ;
44
- if ( ! profilePath ) {
45
- throw new Error ( "--profile command line option not specified" ) ;
46
- }
47
- if ( ! dojoPath ) {
48
- throw new Error ( "--dojoPath command line option not specified" ) ;
49
- }
50
51
const profileDir = path . resolve ( profilePath ) ;
51
52
const dojoDir = path . resolve ( dojoPath , ".." ) ;
52
53
var util = "../dojo-util" ;
0 commit comments