1.0.1 • Published 6 years ago

umi-plugin-script v1.0.1

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

umi-plugin-script

NPM version NPM downloads

解决不知道前端部署的时候 ip 地址需要由现场部署人员配置一些现场的配置参数

相比提取document.ejs提取到pages下面是一种更好的解决方案

保持文件结构整洁,为部署人员提供部署时自定义的配置项

Install

# or yarn
$ npm install
$ npm run build --watch
$ npm run start

Usage

Configure in config/config.js,

export default {
  plugins: [["umi-plugin-script", {
    path?:filepath
  }]]
};

更具 umi 的目录约束

资源文件在 public/ 下面

所以 path 写成 config/index.js

代表项目中的 public/config/index.js

Options

参数必填默认值备注
path非必填config/index.jspath 可以是"config/config.js"或者是 “config/config1.js”,"config/config2.js"

Warnning

如何使用插件后页面出现 umi Uncaught SyntaxError: Unexpected token < 报错,请检查引入的 script 的文件是否存在!

LICENSE

MIT

1.0.1

6 years ago

1.0.0

6 years ago

0.3.1

6 years ago