1.0.2 • Published 2 years ago

jjb-api-loader v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

1.webpack config

module.exports = {
  module: {
    rules: [
      {
        test: /\.api$/,
        include: [ srcPath ],
        use: 'jjb-api-loader'
      }
    ]
  }
}

2.file example

index.api

// Login
Login Post args https://api.xxx.com/login

3.usage

import { Login } from './index.api';
// call
Login({
  userName: 'xxx',
  password: 'xxx'
}).then(res => console.log(res))