@taro-minify-pack/plugin-remote-assets 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
## @taro-minify-pack/plugin-remote-assets
|
|
2
|
+
> 自动上传资源文件并替换路径
|
|
3
|
+
>
|
|
4
|
+
> 注:由于 `@tarojs/webpack5-runner` 不支持绝对路径注册 `postcss` 插件注册注册,已向`Taro`官方提交[pullRequest](https://github.com/NervJS/taro/pull/18683),有需要的可以参考[pullRequest](https://github.com/NervJS/taro/pull/18683/files)自行 patch
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
### 安装
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @taro-minify-pack/plugin-remote-assets
|
|
11
|
+
```
|
|
12
|
+
#### yarn 安装
|
|
13
|
+
```bash
|
|
14
|
+
yarn add @taro-minify-pack/plugin-remote-assets
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
#### pnpm 安装
|
|
18
|
+
```bash
|
|
19
|
+
pnpm add @taro-minify-pack/plugin-remote-assets
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### 配置
|
|
23
|
+
```js
|
|
24
|
+
// config/index.js
|
|
25
|
+
module.exports = {
|
|
26
|
+
plugins: [
|
|
27
|
+
['@taro-minify-pack/plugin-remote-assets', {
|
|
28
|
+
// 路径别名
|
|
29
|
+
pathAlias: {
|
|
30
|
+
'@': path.resolve(__dirname, '../src/'),
|
|
31
|
+
'~@': path.resolve(__dirname, '../src/'),
|
|
32
|
+
},
|
|
33
|
+
// 资源文件目录
|
|
34
|
+
assetsDirPath: path.resolve(__dirname, '../src/assets/'),
|
|
35
|
+
// 上传适配器
|
|
36
|
+
uploader: aliOssUploadAdapter({
|
|
37
|
+
customDomain:'https://your-custom-domain.com',
|
|
38
|
+
accessKeyId: 'your-access-key-id',
|
|
39
|
+
accessKeySecret: 'your-access-key-secret',
|
|
40
|
+
bucket: 'your-bucket-name',
|
|
41
|
+
bucketDir: 'bucketDir',
|
|
42
|
+
region: 'your-region',
|
|
43
|
+
})
|
|
44
|
+
}],
|
|
45
|
+
],
|
|
46
|
+
};
|
|
47
|
+
```
|
|
48
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taro-minify-pack/plugin-remote-assets",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"url": "git+https://github.com/panyu97py/taro-minify-pack.git"
|
|
14
14
|
},
|
|
15
15
|
"author": "yu.pan",
|
|
16
|
-
"license": "
|
|
16
|
+
"license": "MIT",
|
|
17
17
|
"peerDependencies": {
|
|
18
18
|
"@tarojs/service": "^3.0.0"
|
|
19
19
|
},
|