Skip to content

Commit 0ddb5a9

Browse files
committed
chore: clear
1 parent 77e30f4 commit 0ddb5a9

File tree

8 files changed

+45
-102
lines changed

8 files changed

+45
-102
lines changed

generator/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ module.exports = (api, option, rootOptions) => {
44
// 扩展 package.json
55
api.extendPackage({
66
dependencies: {
7-
"react": "^16.0.0",
8-
"react-dom": "^16.0.0"
7+
"react": "^16.8.4",
8+
"react-dom": "^16.8.4"
99
},
1010
devDependencies: {
11-
"babel-preset-react-app": "^6.0.0"
11+
"babel-preset-react-app": "^7.0.2"
1212
},
1313
eslintConfig: {
1414
"extends": [
1515
"plugin:react/recommended",
1616
]
1717
},
1818
scripts: {
19-
"vueconf": "vue-cli-service vueconf"
19+
"config": "vue-cli-service config"
2020
},
2121
});
2222
// 渲染模板

generator/template/src/App.css

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,8 @@
88
}
99

1010
.App-header {
11-
<% if (appStyle === 'Vue') { %>
12-
background-color: #FFF;
13-
color: #2c3e50;
14-
<% } else { %>
1511
background-color: #282c34;
1612
color: white;
17-
<% } %>
1813
min-height: 100vh;
1914
display: flex;
2015
flex-direction: column;
@@ -24,18 +19,15 @@
2419
}
2520

2621
.App-link {
27-
<% if (appStyle === 'Vue') { %>
28-
color: #3eaf7c;
29-
<% } else { %>
3022
color: #61dafb;
31-
<% } %>
3223
}
3324

3425
@keyframes App-logo-spin {
3526
from {
3627
transform: rotate(0deg);
3728
}
29+
3830
to {
3931
transform: rotate(360deg);
4032
}
41-
}
33+
}

generator/template/src/App.js

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
import React, { Component } from 'react';
2-
<% if (appStyle === 'Vue') { %>
3-
import logo from './assets/logo.png';
4-
<% } else { %>
5-
import logo from './logo.svg';
6-
<% } %>
7-
import './App.css';
1+
import React, { Component } from "react"
2+
import logo from "./logo.svg"
3+
import "./App.css"
84

95
class App extends Component {
106
render() {
@@ -21,16 +17,12 @@ class App extends Component {
2117
target="_blank"
2218
rel="noopener noreferrer"
2319
>
24-
<% if (appStyle === 'Vue') { %>
25-
I love Vue!
26-
<% } else { %>
2720
Learn React
28-
<% } %>
2921
</a>
3022
</header>
3123
</div>
32-
);
24+
)
3325
}
3426
}
3527

36-
export default App;
28+
export default App

generator/template/src/index.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ body {
1111
code {
1212
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
1313
monospace;
14-
}
14+
}

index.js

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,30 @@
11
module.exports = (api, projectOptions) => {
2-
api.chainWebpack(webpackConfig => {
3-
webpackConfig
4-
.entry('app')
5-
.delete('./src/main.js')
6-
.add('./src/index.js')
7-
.end();
8-
});
2+
api.chainWebpack(webpackConfig => {
3+
webpackConfig
4+
.entry('app')
5+
.delete('./src/main.js')
6+
.add('./src/index.js')
7+
.end()
98

10-
api.registerCommand(
11-
'vueconf', {
12-
description: 'test',
13-
usage: 'vue-cli-service vueconf',
14-
options: {}
15-
},
16-
(args) => {
17-
console.log('测试输出projectOptions(包含pluginOptions)');
18-
console.log(projectOptions);
19-
}
20-
);
21-
};
9+
webpackConfig.module
10+
.rule('babel')
11+
.test(/\.js?$/)
12+
.use('babel-loader')
13+
.loader('babel-loader')
14+
.end()
15+
16+
webpackConfig.resolve.delete('vue-loader')
17+
})
18+
19+
api.registerCommand(
20+
'config',
21+
{
22+
description: 'test',
23+
usage: 'vue-cli-service config',
24+
options: {}
25+
},
26+
() => {
27+
console.log(projectOptions)
28+
}
29+
)
30+
}

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"name": "vue-cli-plugin-react",
3-
"version": "1.0.0",
2+
"name": "@o3o/vue-cli-plugin-react",
3+
"version": "0.1.0",
44
"description": "",
55
"main": "index.js",
66
"scripts": {
77
"test": "echo \"Error: no test specified\" && exit 1"
88
},
9-
"author": "",
10-
"license": "ISC"
11-
}
9+
"author": "aircity <aircity@drrr.us>",
10+
"license": "MIT"
11+
}

prompts.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

ui.js

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)