Skip to content

Commit

Permalink
✨ feat: 完成添加console.log的打印
Browse files Browse the repository at this point in the history
  • Loading branch information
Saber-Kurama committed Apr 12, 2023
1 parent 316a094 commit 933a322
Show file tree
Hide file tree
Showing 14 changed files with 1,523 additions and 1,211 deletions.
17 changes: 17 additions & 0 deletions demo/webpack-demo/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"private": true,
"scripts": {
"dev": "nodemon -w '../src/**/*.ts' -e .ts -x webpack build"
},
"dependencies": {
"git-repo-info": "^2.1.1",
"html-loader": "^4.2.0",
"webpack": "^5.78.0",
"webpack-cli": "^5.0.1"
},
"devDependencies": {
"html-webpack-plugin": "^5.5.0",
"ts-loader": "^9.4.2",
"typescript": "^4.9.5"
}
}
118 changes: 118 additions & 0 deletions demo/webpack-demo/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>元数据管理平台</title>
</head>

<body>
<div id="app">
<style>
.first-loading-wrap {
display: flex;
width: 100%;
height: 100vh;
justify-content: center;
align-items: center;
flex-direction: column;
}

.first-loading-wrap>h1 {
font-size: 128px;
}

.first-loading-wrap .loading-wrap {
padding: 98px;
display: flex;
justify-content: center;
align-items: center;
}

.dot {
animation: antRotate 1.2s infinite linear;
transform: rotate(45deg);
position: relative;
display: inline-block;
font-size: 32px;
width: 32px;
height: 32px;
box-sizing: border-box;
}

.dot i {
width: 14px;
height: 14px;
position: absolute;
display: block;
background-color: #1890ff;
border-radius: 100%;
transform: scale(0.75);
transform-origin: 50% 50%;
opacity: 0.3;
animation: antSpinMove 1s infinite linear alternate;
}

.dot i:nth-child(1) {
top: 0;
left: 0;
}

.dot i:nth-child(2) {
top: 0;
right: 0;
-webkit-animation-delay: 0.4s;
animation-delay: 0.4s;
}

.dot i:nth-child(3) {
right: 0;
bottom: 0;
-webkit-animation-delay: 0.8s;
animation-delay: 0.8s;
}

.dot i:nth-child(4) {
bottom: 0;
left: 0;
-webkit-animation-delay: 1.2s;
animation-delay: 1.2s;
}

@keyframes antRotate {
to {
-webkit-transform: rotate(405deg);
transform: rotate(405deg);
}
}

@-webkit-keyframes antRotate {
to {
-webkit-transform: rotate(405deg);
transform: rotate(405deg);
}
}

@keyframes antSpinMove {
to {
opacity: 1;
}
}

@-webkit-keyframes antSpinMove {
to {
opacity: 1;
}
}
</style>
<div class="first-loading-wrap">
<div class="loading-wrap">
<span class="dot dot-spin"><i></i><i></i><i></i><i></i></span>
</div>
</div>
</div>
</body>

</html>
1 change: 1 addition & 0 deletions demo/webpack-demo/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
document.getElementById("app")!.innerHTML = "__UNPLUGIN__";
30 changes: 30 additions & 0 deletions demo/webpack-demo/webpack.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// const MyExampleWebpackPlugin = require("../../src/index.js");
import HtmlWebpackPlugin from "html-webpack-plugin";
import Unplugin from "../../src/webpack";

export default {
mode: "development",
entry: "./src/index.ts",
module: {
rules: [
{
test: /\.tsx?$/,
use: "ts-loader",
exclude: /node_modules/,
},
{
test: /\.html$/i,
loader: "html-loader",
},
],
},
plugins: [
new HtmlWebpackPlugin({
template: "public/index.html",
}),
Unplugin(),
],
resolve: {
extensions: [".ts"],
},
};
22 changes: 12 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,23 +84,25 @@
"test": "vitest"
},
"dependencies": {
"unplugin": "^1.0.1"
"git-repo-info": "^2.1.1",
"unplugin": "^1.3.1",
"unplugin-html": "^0.0.0"
},
"devDependencies": {
"@antfu/eslint-config": "^0.33.1",
"@types/node": "^18.11.13",
"@types/node": "^18.15.11",
"bumpp": "^8.2.1",
"chalk": "^5.2.0",
"eslint": "^8.29.0",
"eslint": "^8.37.0",
"esno": "^0.16.3",
"fast-glob": "^3.2.12",
"nodemon": "^2.0.20",
"nodemon": "^2.0.22",
"rimraf": "^3.0.2",
"rollup": "^3.7.3",
"tsup": "^6.5.0",
"typescript": "^4.9.4",
"vite": "^4.0.0",
"vitest": "^0.25.7",
"webpack": "^5.75.0"
"rollup": "^3.20.2",
"tsup": "^6.7.0",
"typescript": "^4.9.5",
"vite": "^4.2.1",
"vitest": "^0.25.8",
"webpack": "^5.77.0"
}
}
6 changes: 3 additions & 3 deletions playground/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"private": true,
"scripts": {
"dev": "nodemon -w '../src/**/*.ts' -e .ts -x vite"
"dev": "nodemon -w '../src/**/*.ts' -e .ts -x vite build"
},
"devDependencies": {
"vite": "^4.0.0",
"vite-plugin-inspect": "^0.7.10"
"vite": "^4.2.1",
"vite-plugin-inspect": "^0.7.18"
}
}
Loading

0 comments on commit 933a322

Please sign in to comment.