11const path = require ( 'path' ) ;
22const webpack = require ( 'webpack' ) ;
3- const MoveFilePlugin = require ( './plugins/MoveFilePlugin' ) ;
43
54// First check if we can load Comunica form cwd, if not, fallback to the default
65let pathToComunica ;
@@ -14,7 +13,7 @@ catch {
1413 comunicaOverride = false ;
1514}
1615
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
1817// and have the options propagated to the plugins
1918const baseURL = {
2019 search : '<%= baseURL %>' ,
@@ -24,12 +23,6 @@ const baseURL = {
2423 flags : 'g'
2524}
2625
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-
3326module . exports = [
3427 {
3528 entry : [
@@ -48,6 +41,7 @@ module.exports = [
4841 path . join ( __dirname , './images/sparql.png' ) ,
4942 path . join ( __dirname , './favicon.ico' ) ,
5043 path . join ( __dirname , './solid-client-id.jsonld' ) ,
44+ path . join ( process . cwd ( ) , './queries.json' ) ,
5145 ] ,
5246 output : {
5347 filename : 'scripts/ldf-client-ui.min.js' ,
@@ -59,11 +53,6 @@ module.exports = [
5953 jQuery : path . join ( __dirname , '/deps/jquery-2.1.0.js' ) ,
6054 } ) ,
6155 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- ) ,
6756 ] ,
6857 module : {
6958 rules : [
@@ -166,6 +155,6 @@ module.exports = [
166155 } ,
167156] ;
168157
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
170160module . exports . baseURL = baseURL ;
171- module . exports . buildContext = buildContext ;
0 commit comments