mr

2018-09-16 admin

mr是什么

什么是mr,A refresh-only CommonJS module system for browsers, used in Montage

mr使用教程帮助文档

Montage Require (aka mr)

npm version

Build Status

Analytics

This is a CommonJS module system, highly compatible with NodeJS, intended for front-end development of web applications using npm style packages. It is designed to be automatically replaced by the Montage Optimizer with a smaller, faster and bundled production module system.

Mr is installed as a package in your application using npm:

$ npm init                  # if you don't already have a package.json
$ npm install --save mr

In an HTML file next to your package.json add the Mr script and provide a module to load:

<script src="node_modules/mr/bootstrap.js" data-module="index"></script>

Start writing your code in index.js, using the require function as you would in Node. Have a look at the demo for working example.

You can place your package.json in a different location, or avoid having one at all, with other script tag attributes.

Optimization

Take a look at Mop, the Montage Optimizer to optimize applications for production. The optimizer can bundle packages with all of the dependent modules, can preload bundles of progressive enhancements in phases, and can generate HTML5 application cache manifests.

Documentation

Mr is compatible with Node and npm, although there are some differences.

There is documentation for:

And you may be interested in an in-depth look at how Mr works.

Compatibility

At present, Mr depends on document.querySelector and probably several other recent EcmaScript methods that might not be available in legacy browsers. With your help, I intend to isolate and fix these bugs.

At time of writing, tests pass in Chrome 21, Safari 5.1.5, and Firefox 13 on Mac OS 10.6.

Maintenance

Tests are in the spec directory. Use npm test to run the tests in NodeJS or open spec/run.html in a browser.

To run the tests in your browser, simply use npm run test:jasmine.

To run the tests using Karma use npm run test:karma and for continious tests run with file changes detection npm run test:karma-dev.

About

This implementation is a part from Motorola Mobility’s Montage web application framework. The module system was written by Tom Robinson and Kris Kowal. Motorola holds the copyright on much of the original content, and provided it as open source under the permissive BSD 3-Clause license. This project is maintained by Kris Kowal and Stuart Knightley, continuing with that license.

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-40394.html

文章标题:mr

相关文章
mri
mri是什么 什么是mri,Quickly scan for CLI flags and arguments mri官网:官网 mri源码仓库:源码仓库 mri下载地址:点此下载 点此下载2 mri使用教程帮助文档 mri Quic...
2018-09-05
JavaScript Domready?
Nipunakristian nissen提出了一个问题:javascript domready?,或许与您遇到的问题类似。 回答者Yehia给出了该问题的处理方式: i’ve updated the code of DOMAssistan...
2018-03-31
mrm-core
mrm-core是什么 什么是mrm-core,Utilities to make tasks for Mrm mrm-core官网:官网 mrm-core源码仓库:源码仓库 mrm-core下载地址:点此下载 点此下载2 mrm-co...
2018-10-11
react-css-themr
react-css-themr是什么 什么是react-css-themr,React CSS Themr react-css-themr官网:官网 react-css-themr源码仓库:源码仓库 react-css-themr下载地址...
2019-01-29
local-or-home-npmrc
local-or-home-npmrc是什么 什么是local-or-home-npmrc,Get the local npmrc with fallback to the global one that's in your home di...
2018-10-31
tslint-config-mrmlnc
tslint-config-mrmlnc是什么 什么是tslint-config-mrmlnc,Just my personal configuration for easy distribution between my packages...
2019-01-19
spawn-rmrf
spawn-rmrf是什么 什么是spawn-rmrf,Removes recursively with rm -rf ./file/path (spawned), then executes a callback on end (opti...
2019-02-09
jscs-preset-mrjoelkemp
jscs-preset-mrjoelkemp是什么 什么是jscs-preset-mrjoelkemp,My JSCS config jscs-preset-mrjoelkemp官网:官网 jscs-preset-mrjoelkemp源码...
2018-11-14
browserify-hmr
browserify-hmr是什么 什么是browserify-hmr,Hot Module Replacement plugin for Browserify browserify-hmr官网:官网 browserify-hmr源码仓库...
2019-01-31
streamroller
streamroller是什么 什么是streamroller,file streams that roll over when size limits, or dates are reached streamroller官网:官网 st...
2018-12-19
回到顶部