var lib = require('../../lib')


module.exports = function configClient (vfs, baseConfig, moduleArgs) {
  if ( moduleArgs.length >= 2 ) {
    throw new lib.errors.ModuleError('Module `less` only takes 1 argument')
  }

  var serverConfig = lib.clone(baseConfig.server)

  serverConfig.routerPipeline.unshift('./style-bundles.js')

  //
  // Inject link tag into main html file
  //
  var htmlPath = baseConfig.projectRoot + '/client/public/index.html'
  var html     = vfs.read(htmlPath)

  var spaces = html.match(/( *)<\/head>/)[1]
  var result = html.replace(
    '</head>',
    `  <link rel="stylesheet" type="text/css" href="/app-bundle.css">\n${ spaces }</head>`
  )
  vfs.write(htmlPath, result)


  var config = {
    dependencies: {
      "node-less-endpoint": "0.x",
    },
    server: serverConfig,
  }

  config.installs = Object.keys(config.dependencies)

  return config
}

@@ -324,16 +324,17 @@
 s.js')%0A%0A
+%0A
   //%0A  /
@@ -376,16 +376,185 @@
 le%0A  //%0A
+  var isSpa   = baseConfig.package.addedPultModules.includes('spa')%0A  var isMarko = baseConfig.package.addedPultModules.includes('marko')%0A%0A  if ( isSpa %7C%7C isMarko ) %7B%0A  
   var ht
@@ -586,16 +586,32 @@
 ctRoot +
+ (%0A      isSpa ?
  '/clien
@@ -630,17 +630,64 @@
 ex.html'
-%0A
+ : '/client/pages/_layouts/main.marko'%0A    )%0A%0A  
   var ht
@@ -713,24 +713,26 @@
 tmlPath)%0A%0A  
+ 
+ 
 var spaces =
@@ -762,16 +762,18 @@
 d%3E/)%5B1%5D%0A
+  
   var re
@@ -797,16 +797,18 @@
 ce(%0A    
+ 
+ 
 '%3C/head%3E
@@ -810,16 +810,18 @@
 head%3E',%0A
+  
     %60  %3C
@@ -905,18 +905,22 @@
 ead%3E%60%0A  
+ 
+ 
 )%0A
+  
   vfs.wr
@@ -941,16 +941,20 @@
 result)%0A
+  %7D%0A
 %0A%0A  var 

Support marko module