@yidun/cdn-upload-webpack-plugin 1.1.1 → 1.1.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/.eslintignore CHANGED
@@ -1,3 +1,3 @@
1
- /dist/
2
- /dashboard/
1
+ /dist/
2
+ /dashboard/
3
3
  node_modules
package/.eslintrc.js CHANGED
@@ -1,9 +1,9 @@
1
- module.exports = {
2
- root: true,
3
- env: {
4
- node: true
5
- },
6
- extends: [
7
- 'standard'
8
- ]
9
- }
1
+ module.exports = {
2
+ root: true,
3
+ env: {
4
+ node: true
5
+ },
6
+ extends: [
7
+ 'standard'
8
+ ]
9
+ }
package/README.md CHANGED
@@ -1,45 +1,45 @@
1
- ## cdn-upload-webpack-plugin, 用于将静态资源上传到 cdn
2
-
3
- ### usage
4
-
5
- ### 构造函数
6
-
7
- ```
8
- /**
9
- * @param {Object} options
10
- * @param {Array|String} dirs 待上传的文件目录
11
- * @param {Boolean} includeRootDir 文件的相对路径计算时包不包含根目录,默认 true
12
- * @param {RegExp|Array<RegExp>} ignores 排除特定文件
13
- * @param {Object} client 上传 client 配置,目前只支持 NosClient,不同的 client 配置参数可能不同,以 nos 举例
14
- * @param {String} accessId
15
- * @param {String} secretKey
16
- * @param {String} bucket 桶名
17
- * @param {String} namespace 不同项目在使用同一个桶时做隔离
18
- */
19
- new CdnUploadWebpackPlugin(options)
20
- ```
21
-
22
- ### 以 vue-cli 项目举例
23
-
24
- ```
25
- configureWebpack: config => {
26
- if (process.env.NODE_ENV === 'production') {
27
- config.plugins.push(...[
28
- new CdnUploadWebpackPlugin({
29
- dirs: path.resolve(__dirname, './dist'),
30
- ignore: /.html$/,
31
- client: {
32
- bucket: '',
33
- accessId: '',
34
- secretKey: '',
35
- namespace: 'yidunfe/cdntest'
36
- }
37
- })
38
- ])
39
- }
40
- },
41
- ```
42
-
43
- ### adaptor
44
-
1
+ ## cdn-upload-webpack-plugin, 用于将静态资源上传到 cdn
2
+
3
+ ### usage
4
+
5
+ ### 构造函数
6
+
7
+ ```
8
+ /**
9
+ * @param {Object} options
10
+ * @param {Array|String} dirs 待上传的文件目录
11
+ * @param {Boolean} includeRootDir 文件的相对路径计算时包不包含根目录,默认 true
12
+ * @param {RegExp|Array<RegExp>} ignores 排除特定文件
13
+ * @param {Object} client 上传 client 配置,目前只支持 NosClient,不同的 client 配置参数可能不同,以 nos 举例
14
+ * @param {String} accessId
15
+ * @param {String} secretKey
16
+ * @param {String} bucket 桶名
17
+ * @param {String} namespace 不同项目在使用同一个桶时做隔离
18
+ */
19
+ new CdnUploadWebpackPlugin(options)
20
+ ```
21
+
22
+ ### 以 vue-cli 项目举例
23
+
24
+ ```
25
+ configureWebpack: config => {
26
+ if (process.env.NODE_ENV === 'production') {
27
+ config.plugins.push(...[
28
+ new CdnUploadWebpackPlugin({
29
+ dirs: path.resolve(__dirname, './dist'),
30
+ ignore: /.html$/,
31
+ client: {
32
+ bucket: '',
33
+ accessId: '',
34
+ secretKey: '',
35
+ namespace: 'yidunfe/cdntest'
36
+ }
37
+ })
38
+ ])
39
+ }
40
+ },
41
+ ```
42
+
43
+ ### adaptor
44
+
45
45
  目前仅支持 nos 上传,后续如有其他的上传需求,可自行扩展 adaptor,可通过 client 参数区分
@@ -0,0 +1,3 @@
1
+ {
2
+ "recommendations": ["Vue.volar"]
3
+ }
@@ -0,0 +1,4 @@
1
+ # Example
2
+
3
+ * 在根目录下 `npm link`
4
+ * 在example目录下 `npm link @yidun/cdn-upload-webpack-plugin`
@@ -0,0 +1,13 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>Vite + Vue + TS</title>
8
+ </head>
9
+ <body>
10
+ <div id="app"></div>
11
+ <script type="module" src="/src/main.ts"></script>
12
+ </body>
13
+ </html>