Просмотр исходного кода

Fix make failure caused by npm link

j8
Lyubomir Marinov 8 лет назад
Родитель
Сommit
6d90adcdf6
1 измененных файлов: 11 добавлений и 6 удалений
  1. 11
    6
      webpack.config.js

+ 11
- 6
webpack.config.js Просмотреть файл

10
 var minimize
10
 var minimize
11
     = process.argv.indexOf('-p') != -1
11
     = process.argv.indexOf('-p') != -1
12
         || process.argv.indexOf('--optimize-minimize') != -1;
12
         || process.argv.indexOf('--optimize-minimize') != -1;
13
+var node_modules = __dirname + '/node_modules/';
13
 var plugins = [
14
 var plugins = [
14
     new HasteResolverPlugin()
15
     new HasteResolverPlugin()
15
 ];
16
 ];
35
             // Transpile ES2015 (aka ES6) to ES5. Accept the JSX syntax by React
36
             // Transpile ES2015 (aka ES6) to ES5. Accept the JSX syntax by React
36
             // as well.
37
             // as well.
37
 
38
 
38
-            exclude: __dirname + '/node_modules/',
39
+            exclude: node_modules,
39
             loader: 'babel',
40
             loader: 'babel',
40
             query: {
41
             query: {
42
+                // XXX The require.resolve bellow solves failures to locate the
43
+                // presets when lib-jitsi-meet, for example, is npm linked in
44
+                // jitsi-meet. The require.resolve, of course, mandates the use
45
+                // of the prefix babel-preset- in the preset names.
41
                 presets: [
46
                 presets: [
42
-                    'es2015',
43
-                    'react',
44
-                    'stage-1'
45
-                ]
47
+                    'babel-preset-es2015',
48
+                    'babel-preset-react',
49
+                    'babel-preset-stage-1'
50
+                ].map(require.resolve)
46
             },
51
             },
47
             test: /\.jsx?$/
52
             test: /\.jsx?$/
48
         },{
53
         },{
80
         },{
85
         },{
81
             //Adds the ability to import json files.
86
             //Adds the ability to import json files.
82
             loader: 'json',
87
             loader: 'json',
83
-            exclude: __dirname + '/node_modules/',
88
+            exclude: node_modules,
84
             test: /\.json$/
89
             test: /\.json$/
85
         }],
90
         }],
86
         noParse: [
91
         noParse: [

Загрузка…
Отмена
Сохранить