 SMC_LICENSE   = 'AGPLv3'
 WEBAPP_LIB    = misc_node.WEBAPP_LIB
 INPUT         = path.resolve(__dirname, WEBAPP_LIB)
-OUTPUT        = misc_node.OUTPUT_DIR
+OUTPUT        = path.resolve(__dirname, misc_node.OUTPUT_DIR)
 DEVEL         = "development"
 NODE_ENV      = process.env.NODE_ENV || DEVEL
 PRODMODE      = NODE_ENV != DEVEL

                        includes: c.modules.map (m) ->  m.request
                )


plugins = [
    cleanWebpackPlugin,
    #provideGlobals,
    setNODE_ENV,
    banner,
    new webpack.LoaderOptionsPlugin({minimize: true})  # https://webpack.js.org/guides/migrating/#uglifyjsplugin-minimize-loaders
]

if STATICPAGES


    resolve:
        # So we can require('file') instead of require('file.coffee')
        extensions : ['.js', '.json', '.coffee', '.cjsx', '.scss', '.sass']
        modules    : [path.resolve(__dirname),
                      path.resolve(__dirname, WEBAPP_LIB),
                      path.resolve(__dirname, 'smc-util'),
                      path.resolve(__dirname, 'smc-util/node_modules'),
