@@ -15,8 +15,10 @@ const path = require("path");
15
15
// List of esper langauge plugins we want to move into the public directory.
16
16
const targets = [ "lua" , "python" , "coffeescript" ] ;
17
17
18
+ const PWD = process . env . PWD || __dirname ; // __dirname might be undesirable if this is symlinked
19
+
18
20
const aether_webpack_config = {
19
- context : path . resolve ( __dirname ) ,
21
+ context : path . resolve ( PWD ) ,
20
22
entry : {
21
23
aether : "./app/lib/aether/aether.coffee" ,
22
24
// We need to create the html parser ourselves and move it ourselves into
@@ -25,7 +27,7 @@ const aether_webpack_config = {
25
27
} ,
26
28
output : {
27
29
filename : "./aether/build/[name].js" ,
28
- path : path . resolve ( __dirname , 'bower_components' ) ,
30
+ path : path . resolve ( PWD , 'bower_components' ) ,
29
31
} ,
30
32
module : {
31
33
rules : [
@@ -79,13 +81,13 @@ function copyLanguagesFromEsper(targets) {
79
81
. map ( lang => [
80
82
[
81
83
path . join (
82
- __dirname ,
84
+ PWD ,
83
85
"bower_components" ,
84
86
"esper.js" ,
85
87
`esper-plugin-lang-${ lang } .js`
86
88
) ,
87
89
path . join (
88
- __dirname ,
90
+ PWD ,
89
91
"public" ,
90
92
"javascripts" ,
91
93
"app" ,
@@ -95,13 +97,13 @@ function copyLanguagesFromEsper(targets) {
95
97
] ,
96
98
[
97
99
path . join (
98
- __dirname ,
100
+ PWD ,
99
101
"bower_components" ,
100
102
"esper.js" ,
101
103
`esper-plugin-lang-${ lang } -modern.js`
102
104
) ,
103
105
path . join (
104
- __dirname ,
106
+ PWD ,
105
107
"public" ,
106
108
"javascripts" ,
107
109
"app" ,
@@ -113,22 +115,22 @@ function copyLanguagesFromEsper(targets) {
113
115
. reduce ( ( l , paths ) => l . concat ( paths ) ) ;
114
116
115
117
for ( let [ src , dest ] of target_paths ) {
116
- // const src = path.join(__dirname , 'bower_components', 'esper.js', `esper-plugin-lang-${target}.js`);
117
- // const dest = path.join(__dirname , 'bower_components', 'aether', 'build', `${target}.js`);
118
+ // const src = path.join(PWD , 'bower_components', 'esper.js', `esper-plugin-lang-${target}.js`);
119
+ // const dest = path.join(PWD , 'bower_components', 'aether', 'build', `${target}.js`);
118
120
console . log ( `Copy ${ src } , ${ dest } ` ) ;
119
121
fs . copySync ( src , dest ) ;
120
122
}
121
123
122
124
// Finally copy html as we globally load these within the html iframe.
123
125
const src = path . join (
124
- __dirname ,
126
+ PWD ,
125
127
"bower_components" ,
126
128
"aether" ,
127
129
"build" ,
128
130
"html.js"
129
131
) ;
130
132
const dest = path . join (
131
- __dirname ,
133
+ PWD ,
132
134
"public" ,
133
135
"javascripts" ,
134
136
"app" ,
0 commit comments