1
1
const path = require ( 'path' ) ;
2
2
const webpack = require ( 'webpack' ) ;
3
- const MoveFilePlugin = require ( './plugins/MoveFilePlugin' ) ;
4
3
5
4
// First check if we can load Comunica form cwd, if not, fallback to the default
6
5
let pathToComunica ;
@@ -14,7 +13,7 @@ catch {
14
13
comunicaOverride = false ;
15
14
}
16
15
17
- // Make this an object, so we can mutate it from the top level of the config
16
+ // Make this an object so we can mutate it from the top level of the config
18
17
// and have the options propagated to the plugins
19
18
const baseURL = {
20
19
search : '<%= baseURL %>' ,
@@ -24,12 +23,6 @@ const baseURL = {
24
23
flags : 'g'
25
24
}
26
25
27
- // Make this an object, so we can mutate it from the top level of the config
28
- // and have the options propagated to the plugins
29
- const buildContext = {
30
- dir : 'build' ,
31
- }
32
-
33
26
module . exports = [
34
27
{
35
28
entry : [
@@ -48,6 +41,7 @@ module.exports = [
48
41
path . join ( __dirname , './images/sparql.png' ) ,
49
42
path . join ( __dirname , './favicon.ico' ) ,
50
43
path . join ( __dirname , './solid-client-id.jsonld' ) ,
44
+ path . join ( process . cwd ( ) , './queries.json' ) ,
51
45
] ,
52
46
output : {
53
47
filename : 'scripts/ldf-client-ui.min.js' ,
@@ -59,11 +53,6 @@ module.exports = [
59
53
jQuery : path . join ( __dirname , '/deps/jquery-2.1.0.js' ) ,
60
54
} ) ,
61
55
new webpack . NormalModuleReplacementPlugin ( / ^ c o m u n i c a - p a c k a g e j s o n $ / , ( process . platform === 'win32' ? '' : '!!json-loader!' ) + path . join ( pathToComunica , '../../package.json' ) ) ,
62
- // Include the generated queries.json file by moving it from the current working directory (where it was generated) to the build path.
63
- new MoveFilePlugin (
64
- ( ) => path . join ( process . cwd ( ) , 'queries.json' ) ,
65
- ( ) => path . join ( __dirname , `${ buildContext . dir } /queries.json` )
66
- ) ,
67
56
] ,
68
57
module : {
69
58
rules : [
@@ -166,6 +155,6 @@ module.exports = [
166
155
} ,
167
156
] ;
168
157
169
- // Export the baseURL and buildContext objects, so we can mutate it in the generate script
158
+ // Export the baseURL object so we can mutated it
159
+ // in the generate script
170
160
module . exports . baseURL = baseURL ;
171
- module . exports . buildContext = buildContext ;
0 commit comments