Modify the directory structure
Modify the directory structure
This commit is contained in:
parent
31fbef10e4
commit
4b05d84ea2
175 changed files with 48 additions and 46 deletions
|
@ -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'))
|
||||
|
@ -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'))
|
||||
|
@ -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'))
|
||||
|
@ -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({
|
||||
|
@ -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())
|
||||
|
|
|
@ -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'
|
||||
},
|
||||
|
@ -38,7 +38,7 @@ module.exports = {
|
|||
"style-loader",
|
||||
"css-loader?sourceMap",
|
||||
{
|
||||
publicPath: "../local/dist/"
|
||||
publicPath: "../test/dist/"
|
||||
}
|
||||
),
|
||||
less: ExtractTextPlugin.extract(
|
||||
|
@ -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'
|
||||
})
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue