Skip to content

Commit

Permalink
Modify the directory structure
Browse files Browse the repository at this point in the history
Modify the directory structure
  • Loading branch information
icarusion committed Oct 28, 2016
1 parent 31fbef1 commit 4b05d84
Show file tree
Hide file tree
Showing 175 changed files with 48 additions and 46 deletions.
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,4 @@ npm-debug.log
*.swp
*.swo
*.log
/index.html
/index_prod.html
local/dist
test/dist
12 changes: 6 additions & 6 deletions build/build-style.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var concat = require('gulp-concat');

// 组件的基础css
gulp.task('base', function () {
gulp.src('../styles/index.less')
gulp.src('../src/styles/index.less')
.pipe(less())
.pipe(minifyCSS())
.pipe(rename('iview.css'))
Expand All @@ -23,13 +23,13 @@ gulp.task('base', function () {

// 字体
gulp.task('fonts', function () {
gulp.src('../styles/common/iconfont/fonts/*.*')
gulp.src('../src/styles/common/iconfont/fonts/*.*')
.pipe(gulp.dest('../dist/styles/fonts'))
});

// 文章排版
gulp.task('article', function () {
gulp.src('../styles/article/index.less')
gulp.src('../src/styles/article/index.less')
.pipe(less())
.pipe(minifyCSS())
.pipe(rename('article.css'))
Expand All @@ -38,7 +38,7 @@ gulp.task('article', function () {

// 套装的全部css
gulp.task('pack-all', function () {
gulp.src('../styles/package.less')
gulp.src('../src/styles/package.less')
.pipe(less())
.pipe(minifyCSS())
.pipe(rename('iview.pack.css'))
Expand All @@ -47,7 +47,7 @@ gulp.task('pack-all', function () {

// 每个套装的css
gulp.task('pack', function () {
gulp.src(['../styles/packages/*.less', '!../styles/packages/index.less'])
gulp.src(['../src/styles/packages/*.less', '!../src/styles/packages/index.less'])
.pipe(less())
.pipe(minifyCSS())
.pipe(rename({
Expand All @@ -58,7 +58,7 @@ gulp.task('pack', function () {

// 全部css(包含组件和套装)
gulp.task('all', function () {
gulp.src(['../styles/index.less', '../styles/package.less'])
gulp.src(['../src/styles/index.less', '../src/styles/package.less'])
.pipe(less())
.pipe(concat('iview.all.css'))
.pipe(minifyCSS())
Expand Down
14 changes: 7 additions & 7 deletions build/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ var HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
// 入口
entry: {
main: './local/main',
main: './test/main',
vendors: ['vue', 'vue-router']
},
// 输出
output: {
path: path.join(__dirname, '.././local/dist'),
publicPath: '/local/dist/',
path: path.join(__dirname, '.././test/dist'),
publicPath: '/test/dist/',
filename: '[name].js',
chunkFilename: '[name].chunk.js'
},
Expand All @@ -38,7 +38,7 @@ module.exports = {
"style-loader",
"css-loader?sourceMap",
{
publicPath: "../local/dist/"
publicPath: "../test/dist/"
}
),
less: ExtractTextPlugin.extract(
Expand All @@ -57,15 +57,15 @@ module.exports = {
// require时省略的扩展名,如:require('module') 不需要module.js
extensions: ['', '.js', '.vue'],
alias: {
iview: '../.././index'
iview: '../../src/index'
}
},
plugins: [
new ExtractTextPlugin("[name].css",{ allChunks : true,resolve : ['modules'] }), // 提取CSS
new webpack.optimize.CommonsChunkPlugin('vendors', 'vendors.js'), // 提取第三方库
new HtmlWebpackPlugin({ // 构建html文件
filename: '../../index.html',
template: './local/template/index.html',
filename: '../../test/index.html',
template: './test/template/index.html',
inject: 'body'
})
]
Expand Down
1 change: 0 additions & 1 deletion dist/styles/article.css

This file was deleted.

11 changes: 0 additions & 11 deletions dist/styles/iview.all.css

This file was deleted.

6 changes: 0 additions & 6 deletions dist/styles/iview.css

This file was deleted.

6 changes: 0 additions & 6 deletions dist/styles/iview.pack.css

This file was deleted.

1 change: 0 additions & 1 deletion dist/styles/packages/iview.pack.signin.css

This file was deleted.

1 change: 0 additions & 1 deletion dist/styles/packages/iview.pack.signup.css

This file was deleted.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
"ui",
"framework"
],
"main": "index.js",
"main": "src/index.js",
"scripts": {
"init": "webpack --progress --config build/webpack.config.js",
"dev": "webpack-dev-server --inline --hot --compress --history-api-fallback --port 8081 --config build/webpack.config.js",
"dev": "webpack-dev-server --content-base test --inline --hot --compress --history-api-fallback --port 8081 --config build/webpack.config.js",
"build": "gulp --gulpfile build/build-style.js"
},
"repository": {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions local/components/app.vue → test/components/app.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<style lang="less">
@import "../../styles/index.less";
@import "../../styles/package.less";
@import "../../src/styles/index.less";
@import "../../src/styles/package.less";
</style>
<template>
<div>
Expand Down
10 changes: 10 additions & 0 deletions test/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>Webpack App</title>
<link href="/test/dist/main.css" rel="stylesheet"></head>
<body>
<div id="app"></div>
<script type="text/javascript" src="/test/dist/vendors.js"></script><script type="text/javascript" src="/test/dist/main.js"></script></body>
</html>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions test/src/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>Webpack App</title>
<link href="/test/dist/main.css" rel="stylesheet"></head>
<body>
<div id="app"></div>
<script type="text/javascript" src="/test/dist/vendors.js"></script><script type="text/javascript" src="/test/dist/main.js"></script></body>
</html>
File renamed without changes.
10 changes: 10 additions & 0 deletions test/test/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>Webpack App</title>
<link href="/test/dist/main.css" rel="stylesheet"></head>
<body>
<div id="app"></div>
<script type="text/javascript" src="/test/dist/vendors.js"></script><script type="text/javascript" src="/test/dist/main.js"></script></body>
</html>

0 comments on commit 4b05d84

Please sign in to comment.