mirror of
https://github.com/qlik-oss/nebula.js.git
synced 2025-12-25 01:04:14 -05:00
feat(cli-serve): enable statically served files (#148)
This commit is contained in:
@@ -31,6 +31,10 @@ const options = {
|
||||
port: {
|
||||
type: 'number',
|
||||
},
|
||||
assets: {
|
||||
type: 'string',
|
||||
description: 'Path to a folder that will be served as static files under /assets',
|
||||
},
|
||||
'enigma.host': {
|
||||
type: 'string',
|
||||
default: 'localhost',
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/* eslint global-require: 0 */
|
||||
const path = require('path');
|
||||
const chalk = require('chalk');
|
||||
const express = require('express');
|
||||
|
||||
const webpack = require('webpack');
|
||||
const WebpackDevServer = require('webpack-dev-server');
|
||||
@@ -25,6 +26,7 @@ module.exports = async ({
|
||||
const snapper = snapshotter({
|
||||
host,
|
||||
port,
|
||||
images: serveConfig.images || [],
|
||||
});
|
||||
|
||||
const themes = serveConfig.themes || [];
|
||||
@@ -92,6 +94,10 @@ module.exports = async ({
|
||||
themes: themes.map(theme => theme.key),
|
||||
});
|
||||
});
|
||||
|
||||
if (serveConfig.assets) {
|
||||
app.use('/assets', express.static(serveConfig.assets));
|
||||
}
|
||||
},
|
||||
proxy: [
|
||||
{
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
"body-parser": "^1.19.0",
|
||||
"chalk": "^2.4.2",
|
||||
"cross-env": "^6.0.3",
|
||||
"express": "^4.17.1",
|
||||
"extend": "^3.0.2",
|
||||
"html-webpack-plugin": "^3.2.0",
|
||||
"portfinder": "^1.0.25",
|
||||
|
||||
Reference in New Issue
Block a user