1.0.8 • Published 6 years ago

nui-loader v1.0.8

Weekly downloads
4
License
ISC
Repository
github
Last release
6 years ago

介绍

nui-loader是Nui框架兼容webpack的解释器,能够将框架自身模块化特性转换为webpack可识别的语法。

安装

npm install --save-dev nui-loader

使用

webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        test: /\.js$/,
        use: {
          loader:'nui-loader',
          options:{
            paths:{
              lib:'/script/lib/jquery/'
            },
            alias:{
              jquery:'{lib}/jquery.js'
            }
          }
        }
      }
    ]
  }
}

选项参数

注意事项

使用Nui框架编写模块代码时,4个工厂函数require/imports/extend/renders中除了require,其它三个必须加this.或者module.前缀,否则解释器无法识别

Nui.define(function(){
  var module = this

  this.imports('xxxx')

  this.extend('xxxx', {

  })

  module.renders({
    <div></div>
  })

})
1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago