0.5.2 • Published 7 years ago

nej-commonjs v0.5.2

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

NEJ-CommonJS

NEJ 是网易开源的一体化前端框架,而 NEJ-CommonJS 是 NEJ 的 CommonJS 版本

如何开始

1. 下载安装到本地

$ cd /path/to/yourproject
$ npm i --save nej-commonjs

2. 配置 webpack

由于 NEJ-CommonJS 中在模块内使用了 this 变量,所以需要使用 imports-loader ,来修正 this 指向到 window

a. 安装 imports-loader

$ cnpm i --save-dev imports-loader

b. 配置 webpack.config.js

const webpack = require('webpack')
module.exports = { 
    module: {
        loaders: [{
            test: /nej\-commonjs/,
            loader: "imports-loader?this=>window"
        }]
    },
    plugins: [
        new webpack.DefinePlugin({
            DEBUG: JSON.stringify(false), // 是否为 debug 模式
            CMPT: JSON.stringify(true)    // 是否开启兼容模式,即 `NEJ.C('xxx')`
        })
    ],
}

查看 example

LICENSE

MIT

0.5.2

7 years ago

0.5.1

7 years ago

0.5.0

7 years ago

0.4.0

7 years ago

0.3.0

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago