npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

restackjs-cli

v0.1.2

Published

cli tools for restack

Downloads

3

Readme

restackjs-cli

配置注入

配置存放的目录:{project}/config/${env}.js

使用方法:

import config from 'config'

Reducer导入

方法一:

import reducers from './reducers'

方法二:

let context = require.context("./reducers", true, /\.js$/)
let reducers = requireAllAsObject(context)

app = restack(config) app.routes(routes) app.reducers(reducers) app.run()

cli工具会根据当前的环境,选择对应的配置

Wanted features

  • webpack config merging

遗留问题

为什么项目里需要有webpack的依赖?

项目里需要的webpack依赖:

  • url-loader
  • file-loader
  • css-loader(?)
  • less-loader(?)

如无操作错误,项目里需要有上面两个依赖,理论上,在restack-cli已包含这些依赖,不需要在项目中依赖。

根据猜测,项目中不需要,但项目的依赖的模块需要。 例如restack-adminlte模块,项目引用restack-adminlte/assets/css/bootstrap.css, 而bootstrap.css又通过src: url(...)语法引用其他资源,例如字体,图片等,这时候webpack需要通过这些loader进行加载。 而这时候webpack只会在该模块内查找loader,而这些模块(例如restack-adminlte)又没有这些依赖,因此报错。

根据上述推测,解决方法是,提供css,less等资源的模块,自身需要通过webpack进行编译,将这些资源与css进行构建后,再上传到npm提供别人使用。