浏览代码

Fix make failure caused by npm link

master
Lyubomir Marinov 9 年前
父节点
当前提交
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: [

正在加载...
取消
保存