🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more
Socket
Book a DemoInstallSign in
Socket

nodewebx-server-lite

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodewebx-server-lite

start http server for nodewebx

latest
npmnpm
Version
0.3.28
Version published
Maintainers
1
Created
Source

nodewebx-server

Usage

nodewebx server

LESS使用

version: >= 0.3.11 开始支持

在项目里面只用写less文件,模板里面直接引用.css路径(该文件不需要存在,nodewebx会 根据找该css路径下同名文件的less并编译返回)。

//HTML
<link href="http://127.0.0.1/css/style.css" type="text/css" rel="stylesheet" charset="utf-8">

//LESS文件(不需要手动保证.css文件的存在和更新,server会自动帮你编译)
├── dist
└── src
  ├── css
  │   └── style.less
  └── js

Config

http://127.0.0.1:3000/.config

LiveReload

项目配置文件nodewebx-config.js中新增liveReload段配置:

module.exports = {
  "liveReload": function (vfs, reload) {
    vfs.watch('source/**/*.js', function (event) {
      vfs.src(event.path)
        .pipe(reload());
    });
    vfs.watch('source/**/*.less', function (event) {
      vfs.src('source/css/modules/*.less')
        .pipe(reload({base:__dirname,extname:'.css'}));
    });
  },
  "webx": ...
}

浏览器中安装LiveReload扩展

FAQs

Package last updated on 05 Apr 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts