huan-simple-html 1.0.0 → 1.1.0

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/.eslintrc.cjs CHANGED
@@ -11,6 +11,7 @@ module.exports = {
11
11
  es6: true
12
12
  },
13
13
  parserOptions: {
14
+ ecmaVersion: 11,
14
15
  sourceType: 'module'
15
16
  },
16
17
  extends: ['prettier', 'eslint:recommended', 'plugin:prettier/recommended'],
package/.npmignore CHANGED
@@ -9,8 +9,13 @@ lerna-debug.log*
9
9
 
10
10
  # Node
11
11
  node_modules
12
- huan-simple-html-1.0.0.tgz
13
12
  .npmrc
13
+ pnpm-lock.yaml
14
+ package-lock.json
15
+ yarn.lock
16
+
17
+ # Pack
18
+ huan-*.tgz
14
19
 
15
20
  # Build
16
21
  dist
package/README.md ADDED
@@ -0,0 +1,30 @@
1
+ # 简单的欢迎页面(SIMPLE-HTML)
2
+
3
+ 这是一个简单的欢迎页面,我使用了静态的HTML+CSS+JS进行编码。
4
+
5
+ `index.new.html` 页面,可以作为你的默认建站页面。
6
+
7
+ 错误码页面在error文件夹下。
8
+
9
+ 注意:`.signal.html` 文件为内联样式之后的文件它可以作为一个单独的页面使用。
10
+
11
+ 注意:`.songzihuan.signal.html` 为添加作者个人样式的`signal.html文件`文件。
12
+
13
+ ## 作者信息
14
+ 作者:宋子桓(Song Zihuan)
15
+
16
+ 作者 Github:[github.com/SongZihuan](https://github.com/SongZihuan)
17
+
18
+ 作者主页:[song-zh.com](https://song-zh.com)
19
+
20
+ 作者邮箱:songzihuan@song-zh.com
21
+
22
+ ## 项目信息
23
+ 项目托管地址:[github.com/SongZihuan/simple-html](https://github.com/SongZihuan/simple-html)
24
+ Github Page托管: [github.com/huan-simple-html/huan-simple-html.github.io](https://github.com/huan-simple-html/huan-simple-html.github.io)
25
+ 测试访问:[homepage.song-zh.com](https://homepage.song-zh.com/)
26
+
27
+ 最后更新时间:2025年1月22日。
28
+
29
+ ## 特别注意
30
+ 备注:以上README为作者原文。
package/README_EN.md ADDED
@@ -0,0 +1,30 @@
1
+ # Simple Welcome Page (SIMPLE-HTML)
2
+
3
+ This is a simple welcome page. I used static HTML+CSS+JS to code it.
4
+
5
+ The `index.new.html` page can be used as your default website page.
6
+
7
+ The error code page is in the error folder.
8
+
9
+ Note: The `.signal.html` file is a file after the inline style. It can be used as a separate page.
10
+
11
+ Note: `.songzihuan.signal.html` is the `signal.html file` file with the author's personal style added.
12
+
13
+ ## Author information
14
+ Author: Song Zihuan
15
+
16
+ Author Github: [github.com/SongZihuan](https://github.com/SongZihuan)
17
+
18
+ Author homepage: [song-zh.com](https://song-zh.com)
19
+
20
+ Author email: songzihuan@song-zh.com
21
+
22
+ ## Project information
23
+ Project hosting address: [github.com/SongZihuan/simple-html](https://github.com/SongZihuan/simple-html)
24
+ Github Page hosting: [github.com/huan-simple-html/huan-simple-html.github.io](https://github.com/huan-simple-html/huan-simple-html.github.io)
25
+ Test access: [homepage.song-zh.com](https://homepage.song-zh.com/)
26
+
27
+ Last updated: January 22, 2025.
28
+
29
+ ## Special Note
30
+ Note: The above is the English translation of the author's [README.md](/README.md) (machine translation involved)
@@ -0,0 +1,36 @@
1
+ const config = {
2
+ presets: [
3
+ [
4
+ '@babel/preset-env', // 使用 @babel/preset-env 转换语法
5
+ {
6
+ // 目标环境配置,根据需要调整
7
+ targets: {
8
+ browsers: [
9
+ // 你可以指定具体的浏览器版本,例如:
10
+ // "last 2 versions",
11
+ // ">= 1%",
12
+ // "Chrome >= 49",
13
+ // "Firefox >= 45",
14
+ // 或使用 "defaults" 自动选择一组常见的浏览器版本
15
+ 'defaults'
16
+ ]
17
+ },
18
+ // 启用或禁用模块转换
19
+ modules: false, // 或 "auto" / "commonjs"
20
+
21
+ // 可选:按需加载 polyfills
22
+ useBuiltIns: 'usage', // 根据代码实际使用情况自动引入 polyfills
23
+ corejs: 3 // 如果使用按需加载,需要指定 core-js 的版本
24
+
25
+ // 可选:包含或排除特定的 transforms
26
+ // exclude: ['transform-regenerator'], // 例如,排除 regenerator 转换
27
+ // include: ['@babel/plugin-proposal-class-properties'], // 或者包含额外的提案特性
28
+ }
29
+ ]
30
+ ],
31
+
32
+ // 可选:包含全局的 Babel 插件
33
+ plugins: []
34
+ }
35
+
36
+ export default config
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "huan-simple-html",
3
- "version": "1.0.0",
4
- "description": "一个简单的HTML项目,通过Webpack进行打包。请尽量使用pnpm处理此包。更多细节请查看\"README\"",
3
+ "version": "1.1.0",
4
+ "description": "一个简单的HTML项目,通过Webpack进行打包。请尽量使用pnpm处理此包。更多细节请查看\"README.md\"",
5
5
  "keywords": [
6
6
  "html",
7
7
  "css",
@@ -25,7 +25,11 @@
25
25
  "pnpm": ">=8"
26
26
  },
27
27
  "devDependencies": {
28
+ "@babel/core": "^7.26.0",
29
+ "@babel/preset-env": "^7.26.0",
30
+ "babel-loader": "^9.2.1",
28
31
  "copy-webpack-plugin": "^12.0.2",
32
+ "core-js": "3",
29
33
  "css-loader": "^7.1.2",
30
34
  "eslint": "^8.38.0",
31
35
  "eslint-config-prettier": "^8.8.0",
@@ -48,8 +52,8 @@
48
52
  "webpack-cli": "^6.0.1",
49
53
  "webpack-dev-server": "^5.2.0"
50
54
  },
51
- "dependencies": {},
52
55
  "scripts": {
56
+ "init": "npx pnpm install",
53
57
  "lint": "eslint --ext .js,.mjs,.cjs,.ts --fix .",
54
58
  "lint:debug": "eslint --ext .js,.mjs,.cjs,.ts --debug --fix .",
55
59
  "dev": "npx webpack server --config webpack_config_dev.js",
@@ -60,6 +64,9 @@
60
64
  "build:prod:run": "npx pnpm build:prod && npx pnpm prod",
61
65
  "github": "npx webpack server --config webpack_config_github.js",
62
66
  "build:github": "npx webpack --config webpack_config_github.js && node github-page/cname.js",
63
- "build:github:run": "npx pnpm build:github && npx pnpm github"
67
+ "pack": "npx pnpm run init && npx pnpm run lint && npx pnpm pack",
68
+ "build:github:run": "npx pnpm build:github && npx pnpm github",
69
+ "login:npmjs": "npx pnpm login --registry=https://registry.npmjs.org",
70
+ "publish:npmjs": "npx pnpm publish --registry=https://registry.npmjs.org"
64
71
  }
65
72
  }
package/src/common.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // 清理状态
2
2
  import 'normalize.css'
3
- import jQuery from 'jquery';
3
+ import jQuery from 'jquery'
4
4
 
5
5
  import Logo from './assets/image/logo.png'
6
6
  import WangAn from './assets/image/wangan.png'
@@ -20,5 +20,5 @@ window.WangAn = WangAn
20
20
  window.SongZihuan = SongZihuan
21
21
  window.LogoBig = LogoBin
22
22
 
23
- window.jQuery = jQuery;
24
- window.$ = jQuery;
23
+ window.jQuery = jQuery
24
+ window.$ = jQuery
package/src/utils/file.js CHANGED
@@ -1,5 +1,5 @@
1
- import path from "path"
2
- import fs from "fs"
1
+ import path from 'path'
2
+ import fs from 'fs'
3
3
 
4
4
  export default {
5
5
  getAllFilePaths
@@ -1,12 +1,12 @@
1
- import path from "path"
2
- import HtmlWebpackPlugin from "html-webpack-plugin";
3
- import MiniCssExtractPlugin from 'mini-css-extract-plugin';
4
- import CopyWebpackPlugin from "copy-webpack-plugin"
1
+ import path from 'path'
2
+ import HtmlWebpackPlugin from 'html-webpack-plugin'
3
+ import MiniCssExtractPlugin from 'mini-css-extract-plugin'
4
+ import CopyWebpackPlugin from 'copy-webpack-plugin'
5
5
  import filetool from './src/utils/file.js'
6
- import { fileURLToPath } from 'url';
6
+ import { fileURLToPath } from 'url'
7
7
 
8
- const __filename = fileURLToPath(import.meta.url);
9
- const __dirname = path.dirname(__filename);
8
+ const __filename = fileURLToPath(import.meta.url)
9
+ const __dirname = path.dirname(__filename)
10
10
 
11
11
  const mode = 'development'
12
12
  const dist_name = 'dist-dev'
@@ -86,7 +86,7 @@ AllHTMLLocalFile5xx.forEach((filePath) => {
86
86
  )
87
87
  })
88
88
 
89
- const config = {
89
+ const config = {
90
90
  mode: mode,
91
91
 
92
92
  context: __dirname,
@@ -126,6 +126,13 @@ const config = {
126
126
 
127
127
  module: {
128
128
  rules: [
129
+ {
130
+ test: /\.(js|mjs|cjs)$/,
131
+ exclude: /(node_modules|bower_components)/,
132
+ use: {
133
+ loader: 'babel-loader'
134
+ }
135
+ },
129
136
  {
130
137
  test: /\.(css|scss|sass)$/,
131
138
  use: [MiniCssExtractPlugin.loader, 'css-loader', 'postcss-loader', 'sass-loader']
@@ -1,13 +1,13 @@
1
- import path from "path"
2
- import HtmlWebpackPlugin from "html-webpack-plugin";
3
- import MiniCssExtractPlugin from 'mini-css-extract-plugin';
4
- import CopyWebpackPlugin from "copy-webpack-plugin"
5
- import TerserPlugin from 'terser-webpack-plugin';
1
+ import path from 'path'
2
+ import HtmlWebpackPlugin from 'html-webpack-plugin'
3
+ import MiniCssExtractPlugin from 'mini-css-extract-plugin'
4
+ import CopyWebpackPlugin from 'copy-webpack-plugin'
5
+ import TerserPlugin from 'terser-webpack-plugin'
6
6
  import filetool from './src/utils/file.js'
7
- import { fileURLToPath } from 'url';
7
+ import { fileURLToPath } from 'url'
8
8
 
9
- const __filename = fileURLToPath(import.meta.url);
10
- const __dirname = path.dirname(__filename);
9
+ const __filename = fileURLToPath(import.meta.url)
10
+ const __dirname = path.dirname(__filename)
11
11
 
12
12
  const mode = 'production'
13
13
  const dist_name = 'docs'
@@ -154,6 +154,13 @@ const config = {
154
154
 
155
155
  module: {
156
156
  rules: [
157
+ {
158
+ test: /\.(js|mjs|cjs)$/,
159
+ exclude: /(node_modules|bower_components)/,
160
+ use: {
161
+ loader: 'babel-loader'
162
+ }
163
+ },
157
164
  {
158
165
  test: /\.(css|scss|sass)$/,
159
166
  use: [MiniCssExtractPlugin.loader, 'css-loader', 'postcss-loader', 'sass-loader']
@@ -203,7 +210,7 @@ const config = {
203
210
  {
204
211
  test: /\.html$/i,
205
212
  loader: 'html-loader'
206
- },
213
+ }
207
214
  ]
208
215
  },
209
216
 
@@ -290,4 +297,4 @@ const config = {
290
297
  }
291
298
  }
292
299
 
293
- export default config
300
+ export default config
@@ -1,12 +1,12 @@
1
- import path from "path"
2
- import HtmlWebpackPlugin from "html-webpack-plugin";
3
- import MiniCssExtractPlugin from 'mini-css-extract-plugin';
4
- import CopyWebpackPlugin from "copy-webpack-plugin"
1
+ import path from 'path'
2
+ import HtmlWebpackPlugin from 'html-webpack-plugin'
3
+ import MiniCssExtractPlugin from 'mini-css-extract-plugin'
4
+ import CopyWebpackPlugin from 'copy-webpack-plugin'
5
5
  import filetool from './src/utils/file.js'
6
- import { fileURLToPath } from 'url';
6
+ import { fileURLToPath } from 'url'
7
7
 
8
- const __filename = fileURLToPath(import.meta.url);
9
- const __dirname = path.dirname(__filename);
8
+ const __filename = fileURLToPath(import.meta.url)
9
+ const __dirname = path.dirname(__filename)
10
10
 
11
11
  const mode = 'production'
12
12
  const dist_name = 'dist-prod'
@@ -139,6 +139,13 @@ const config = {
139
139
 
140
140
  module: {
141
141
  rules: [
142
+ {
143
+ test: /\.(js|mjs|cjs)$/,
144
+ exclude: /(node_modules|bower_components)/,
145
+ use: {
146
+ loader: 'babel-loader'
147
+ }
148
+ },
142
149
  {
143
150
  test: /\.(css|scss|sass)$/,
144
151
  use: [MiniCssExtractPlugin.loader, 'css-loader', 'postcss-loader', 'sass-loader']
@@ -275,4 +282,4 @@ const config = {
275
282
  }
276
283
  }
277
284
 
278
- export default config
285
+ export default config
package/README DELETED
@@ -1,19 +0,0 @@
1
- 简单的欢迎页面(SIMPLE-HTML)
2
- ===================================
3
- 这是一个简单的欢迎页面,我使用了静态的HTML+CSS+JS进行编码。
4
- index.new.html页面,可以作为你的默认建站页面。
5
- 错误码页面在error文件夹下。
6
- 注意:`.signal.html` 文件为内联样式之后的文件它可以作为一个单独的页面使用。
7
-
8
- 作者:宋子桓(Song Zihuan)
9
- 作者 Github:https://github.com/SongZihuan
10
- 作者主页:https://song-zh.com
11
- 作者邮箱:songzihuan@song-zh.com
12
-
13
- 项目托管地址:https://github.com/SongZihuan/simple-html
14
- Github Page托管: https://github.com/huan-simple-html/huan-simple-html.github.io
15
- 测试访问:https://homepage.song-zh.com/
16
-
17
- 最后更新时间:2025年1月19日。
18
-
19
- 备注:以上README为作者原文。
package/README_EN DELETED
@@ -1,19 +0,0 @@
1
- Simple Welcome Page (SIMPLE-HTML)
2
- ====================================
3
- This is a simple welcome page. I used static HTML+CSS+JS for coding.
4
- The index.new.html page can be used as your default website page.
5
- The error code page is in the error folder.
6
- Note: The `.signal.html` file is a file after inline style. It can be used as a separate page.
7
-
8
- Author: 宋子桓 (Song Zihuan)
9
- Author Github: https://github.com/SongZihuan
10
- Author homepage: https://song-zh.com
11
- Author email: songzihuan@song-zh.com
12
-
13
- Project hosting address: https://github.com/SongZihuan/simple-html
14
- Github Page hosting: https://github.com/huan-simple-html/huan-simple-html.github.io
15
- Test access: https://homepage.song-zh.com/
16
-
17
- Last updated: January 19, 2025.
18
-
19
- Note: The above text is machine translated.