添加ykit

This commit is contained in:
waliang.wang 2017-07-05 19:31:50 +08:00
parent e14f22c94b
commit b1043111f0
14 changed files with 52276 additions and 5 deletions

26507
build/index.js Normal file

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@ import React, { Component } from 'react'
import Routes from './routes'
import './styles/cs.scss'
// import './styles/cs.less'
console.log(4444)
console.log(55555)
class App extends Component {
render() {

View File

@ -5,7 +5,7 @@ export default _ => {
return (
<acticle>
<Header />
<h3>首页</h3>
<h3>首页3333</h3>
</acticle>
)
}

25677
dev/scripts/index.js Normal file

File diff suppressed because it is too large Load Diff

1
dev/scripts/index.js.map Normal file

File diff suppressed because one or more lines are too long

15
dev/styles/index.css Normal file
View File

@ -0,0 +1,15 @@
body {
background-color: #f2f2f2;
}
.app{
position: absolute;
top: 50%;
left: 0;
width: 100%;
color: #444;
text-align: center;
margin: -70px 0 0;
}
/*# sourceMappingURL=index.css.map*/

1
dev/styles/index.css.map Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"styles/index.css","sources":[],"mappings":";;;;;;;;;;;;;","sourceRoot":""}

View File

@ -7,6 +7,6 @@
</head>
<body>
<div id="yapi"></div>
<script src="./build/index.js"></script>
<script src="./dev/scripts/index.js"></script>
</body>
</html>

View File

@ -1,7 +1,7 @@
{
"name": "yapi",
"version": "1.0.0",
"description": "-------------------------------------------------------------------------------- #### **项目管理** #### *PMO*:(http://pmo.corp.qunar.com)<br /> -------------------------------------------------------------------------------- #### **CI/CD**: #### *QDR*:(http://qdr.corp.qunar.com/)<br /> #### *QCI*:(http://qci.corp.qunar.com/)<br /> #### *CABLE*:(http://wanshiwu.corp.qunar.com/qualitycheck/index/)<br />",
"description": "YAPI",
"main": "index.js",
"scripts": {
"start": "webpack-dev-server"
@ -24,7 +24,10 @@
"koa-static": "^3.0.0",
"koa-views": "^5.2.0",
"mongoose": "4.10.8",
"mongoose-auto-increment": "^5.0.1"
"mongoose-auto-increment": "^5.0.1",
"ykit-config-antd": "^0.1.3",
"ykit-config-es6": "^0.4.0",
"ykit-config-react": "^0.4.4"
},
"devDependencies": {
"axios": "^0.16.2",

13
src/scripts/App.js Normal file
View File

@ -0,0 +1,13 @@
import React, { Component } from 'react'
import Routes from './routes'
// import '../..//styles/cs.scss'
// import './styles/cs.less'
console.log(555)
class App extends Component {
render() {
return <Routes />
}
}
export default App

8
src/scripts/index.js Normal file
View File

@ -0,0 +1,8 @@
import React from 'react'
import ReactDOM from 'react-dom'
import App from './App'
ReactDOM.render(
<App />,
document.getElementById('yapi')
)

11
src/scripts/routes.js Normal file
View File

@ -0,0 +1,11 @@
import React from 'react'
import { BrowserRouter as Router, Route, Link } from 'react-router-dom'
import { Home } from '../../client/containers/index'
export default store => {
return (
<Router>
<Route path="/" component={ Home } />
</Router>
)
}

13
src/styles/index.css Normal file
View File

@ -0,0 +1,13 @@
body {
background-color: #f2f2f2;
}
.app{
position: absolute;
top: 50%;
left: 0;
width: 100%;
color: #444;
text-align: center;
margin: -70px 0 0;
}

22
ykit.js Normal file
View File

@ -0,0 +1,22 @@
module.exports = {
plugins: ['react', 'es6', 'antd'],
devtool: 'cheap-source-map',
config: {
exports: [
'./scripts/index.js',
'./styles/index.css'
],
modifyWebpackConfig: function(baseConfig) {
// edit ykit's Webpack configs
baseConfig.watch = true;
console.log(baseConfig)
return baseConfig;
}
},
server: {
hot: true, // true/false默认 false效果相当于 ykit server --hot
overlay: true // true/false默认 false开启后可在当前打开的页面提示打包错误
},
hooks: {},
commands: []
};