@taro-minify-pack/plugin-remote-assets 0.0.1 → 0.0.2

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.
Files changed (2) hide show
  1. package/README.md +48 -0
  2. package/package.json +1 -1
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.1",
3
+ "version": "0.0.2",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",