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 🙏

© 2025 – Pkg Stats / Ryan Hefner

ray-rn2web

v2.0.0

Published

the FED tool for amos team RN to web

Readme

ray-rn2web

descr

基于 webpack 的构建封装.


author

ilex.h

特性

  • 基于 webpack 实现
  • 支持通过 webpack.config.js 进行扩展 webpack 的配置项
  • 将RN转化为web

useage

  1. install
$ npm install --save-dev ray-rn2web
  1. setup webpack.config.js
// webpack.config.js

const rn2webConfig = require('ray-rn2web/lib/simpleConfig');

module.exports = rn2webConfig();

// 注意: 开发环境下,需要修改 toFile 和 tpl 模板,默认选择  root dir/tpl.html output: dist/index.html
// 修改为

var options = {
  tpl: './tpl.html',
  toFile: 'index.html'
  ...
}

// 可采用如下方式进行 dev and prod
var options = {
  alias: alias
};

if('development' === _ENV_){
  options.tpl = './tpl.html';
  options.toFile = 'index.html';
  options.sourceMap = true;
  options.port = 3003;
}

// full custom options
var options = {
  tpl: '',
  toFile: '',
  htmlChunks: [ '', '' ],
  port: 3003,
  alias: alias,
  sourceMap: true
};

// 可自定义设置 htmlWebpackConfig

// var options = {
//   tpl: '',
//   toFile: '',
//   htmlChunks: `string or array`
// }

// other html, add a new plugin
// const HtmlWebpackPlugin = require('html-webpack-plugin');


module.exports = rn2webConfig(options);

// new version
// 采用新版本的打包
const rn2webConfig = require('ray-rn2web/lib/rn2webConfig');
  1. add tpl.html root dir
<!DOCTYPE html>
<html lang="en">

<head>
  <title>ilex.h</title>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
</head>

<body>
  <div id="__web-root__"></div>
</body>

</html>

附录

完整配置, webpack.config.js

const { OpenUrlPlugins, browser, tools } = require('ray-plugins');
const rn2webConfig = require('ray-rn2web/lib/simpleConfig');

var _ENV_ = tools.trim(process.env.NODE_ENV) || 'development';

var alias = {
  'amos-rn-pro': './src'
};

// custom options
var options = {
  alias: alias
};

if('development' === _ENV_){
  options.tpl = './tpl.html';
  options.toFile = 'index.html';
  options.sourceMap = true;
  options.port = 3003;
}

var defaultConfig = rn2webConfig(options);

defaultConfig.entry = {
  app: './src/index.js'
};

if('development' === _ENV_){
  defaultConfig.plugins.push(
    new OpenUrlPlugins({url: 'http://localhost:' + options.port, browser: browser.chrome}) // browser.chrome | browser.firefox
  );
}

module.exports = defaultConfig;

package.json

{
...

"scripts": {
  "start:web": "set NODE_ENV=development && webpack-dev-server"
  ...
}

...
}

tpl.html

<!DOCTYPE html>
<html lang="en">
<head>
  <title>ray rn to web</title>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
  <div id="app"></div>
</body>
</html>

目录结构

|-- node_modules
|-- src
    |--index.js
    |--
    |--
|-- package.json
|-- webpack.config.js
|--...

License

MIT

changelog

2020-5-21 v2.0.0

update [email protected][email protected]、babel@7