Skip to content
This repository was archived by the owner on Feb 22, 2020. It is now read-only.

Commit ec9b564

Browse files
committed
[Setup] Add postcss flow.
1 parent 424bf21 commit ec9b564

9 files changed

+2723
-1262
lines changed

.coveralls.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
repo_token: gV4ylhLoUdSXJjaBaxFcgreo83mphIS7V
1+
repo_token: JcqpvQxxjEOMHf9KoK9GYbKD3iSOPN5Hf

.postcssrc.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"plugins": {
3+
"autoprefixer": {}
4+
}
5+
}

.travis.yml

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
language: node_js
22
node_js:
3-
- "8"
3+
- "8"
44

55
cache: yarn
66

77
install:
8-
- yarn
9-
10-
11-
before_script:
12-
- yarn add global gulp
8+
- yarn
139

1410
script: yarn run test
1511

1612
# Submit Coverage Status to coveralls.io
1713
after_script:
18-
- cat ./test/unit/coverage/lcov.info | ./node_modules/.bin/coveralls
14+
- cat ./test/unit/coverage/lcov.info | ./node_modules/.bin/coveralls

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
[![Build Status](https://travis-ci.org/aquariuslt/vue-boilerplate.svg?branch=master)](https://travis-ci.org/aquariuslt/vue-boilerplate)
44
[![Coverage Status](https://coveralls.io/repos/github/aquariuslt/vue-boilerplate/badge.svg?branch=master)](https://coveralls.io/github/aquariuslt/vue-boilerplate?branch=master)
5+
[![GitHub license](https://img.shields.io/github/license/aquariuslt/vue-boilerplate.svg)](https://github.com/aquariuslt/vue-boilerplate/blob/master/LICENSE)
6+
[![dependencies Status](https://david-dm.org/aquariuslt/vue-boilerplate/status.svg)](https://david-dm.org/aquariuslt/vue-boilerplate)
57

68

79
A Vue Boilerplate different with Official `Vue-Template`.
@@ -13,7 +15,6 @@ Features:
1315
3. Built with Gulp Tasks.
1416

1517

16-
1718
## Get Started
1819

1920
### Install Dependencies

config/base.config.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ let baseConfig = {
88
js: 'static/js',
99
css: 'static/css',
1010
img: 'static/img',
11+
fonts: 'static/fonts',
1112
manifest: 'static/manifest'
1213
},
1314
cache: '.cache',
@@ -18,7 +19,7 @@ let baseConfig = {
1819
assets: [
1920
{
2021
from: 'src/assets',
21-
to: 'assets'
22+
to: 'static'
2223
}
2324
]
2425
},

config/webpack.base.babel.js

+20-3
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,32 @@ let webpackBaseConfig = {
3434
test: /\.less$/,
3535
include: pathUtil.resolve('src'),
3636
loader: ExtractTextPlugin.extract({
37-
use: ['css-loader', 'less-loader'],
37+
use: [
38+
{
39+
loader: 'css-loader',
40+
options: {
41+
importLoaders: 1
42+
}
43+
},
44+
'postcss-loader',
45+
'less-loader'
46+
],
3847
fallback: ['style-loader']
3948
})
4049
},
4150
{
4251
test: /\.css$/,
4352
include: pathUtil.resolve(baseConfig.dir.src),
4453
loader: ExtractTextPlugin.extract({
45-
use: ['css-loader'],
54+
use: [
55+
{
56+
loader: 'css-loader',
57+
options: {
58+
importLoaders: 1
59+
}
60+
},
61+
'postcss-loader'
62+
],
4663
fallback: ['style-loader']
4764
})
4865
},
@@ -62,7 +79,7 @@ let webpackBaseConfig = {
6279
options: {
6380
limit: 10000,
6481
publicPath: './',
65-
name: '[name].[ext]'
82+
name: baseConfig.dir.dist.fonts + '/' + '[name].[ext]'
6683
}
6784
}
6885
]

package.json

+19-14
Original file line numberDiff line numberDiff line change
@@ -21,39 +21,39 @@
2121
"vuex": "^3.0.1"
2222
},
2323
"devDependencies": {
24-
"@babel/core": "7.0.0",
24+
"@babel/core": "7.1.2",
2525
"@babel/plugin-external-helpers": "7.0.0",
26-
"@babel/plugin-proposal-class-properties": "7.0.0",
27-
"@babel/plugin-transform-runtime": "7.0.0",
26+
"@babel/plugin-proposal-class-properties": "7.1.0",
27+
"@babel/plugin-transform-runtime": "7.1.0",
2828
"@babel/polyfill": "7.0.0",
29-
"@babel/preset-env": "7.0.0",
29+
"@babel/preset-env": "7.1.0",
3030
"@babel/register": "7.0.0",
31-
"@babel/runtime": "7.0.0",
31+
"@babel/runtime": "7.1.2",
3232
"@types/extract-text-webpack-plugin": "^3.0.2",
3333
"@types/jest": "^23.1.1",
34-
"@types/marked": "^0.3.0",
34+
"@types/marked": "^0.4.2",
3535
"@types/mocha": "^5.2.0",
3636
"@types/moxios": "^0.4.8",
3737
"@types/sinon": "^5.0.1",
3838
"@types/webpack": "^4.4.11",
3939
"@vue/cli-plugin-unit-jest": "^3.0.1",
40-
"@vue/test-utils": "1.0.0-beta.24",
40+
"@vue/test-utils": "1.0.0-beta.25",
4141
"ajv": "^6.2.0",
42-
"autoprefixer": "^9.1.3",
42+
"autoprefixer": "^9.1.5",
4343
"babel-core": "7.0.0-bridge.0",
44-
"babel-eslint": "^9.0.0",
44+
"babel-eslint": "^10.0.1",
4545
"babel-jest": "^23.4.2",
4646
"babel-loader": "^8.0.0",
4747
"babel-plugin-lodash": "^3.3.4",
4848
"connect-history-api-fallback": "^1.5.0",
4949
"copy-webpack-plugin": "^4.5.1",
5050
"coveralls": "^3.0.0",
51-
"css-loader": "^0.28.11",
51+
"css-loader": "^1.0.0",
5252
"eslint": "^5.4.0",
5353
"eslint-plugin-vue": "^5.0.0-beta.3",
5454
"extract-text-webpack-plugin": "^4.0.0-beta.0",
5555
"fancy-log": "^1.3.2",
56-
"file-loader": "^1.1.11",
56+
"file-loader": "^2.0.0",
5757
"friendly-errors-webpack-plugin": "^1.7.0",
5858
"glob": "^7.1.2",
5959
"gulp": "^3.9.1",
@@ -62,7 +62,7 @@
6262
"gulp-rimraf": "^0.2.2",
6363
"gulp-sequence": "^1.0.0",
6464
"html-webpack-plugin": "^3.2.0",
65-
"http-proxy-middleware": "^0.18.0",
65+
"http-proxy-middleware": "^0.19.0",
6666
"jest": "^23.1.0",
6767
"jest-cli": "^23.1.0",
6868
"jest-serializer-vue": "^2.0.2",
@@ -75,9 +75,14 @@
7575
"moxios": "^0.4.0",
7676
"normalize.css": "^8.0.0",
7777
"offline-plugin": "^5.0.0",
78-
"optimize-css-assets-webpack-plugin": "^4.0.0",
78+
"opn": "^5.4.0",
79+
"optimize-css-assets-webpack-plugin": "^5.0.1",
7980
"optimize-js-plugin": "^0.0.4",
80-
"ora": "^2.0.0",
81+
"ora": "^3.0.0",
82+
"postcss": "^7.0.5",
83+
"postcss-load-config": "^2.0.0",
84+
"postcss-loader": "^3.0.0",
85+
"postcss-pxtorem": "^4.0.1",
8186
"sinon": "^6.1.5",
8287
"style-loader": "^0.23.0",
8388
"url-loader": "^1.1.1",

tasks/serve.js

+6
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@
22
import gulp from 'gulp';
33
import log from 'fancy-log';
44

5+
import opn from 'opn';
56
import webpack from 'webpack';
67
import WebpackDevServer from 'webpack-dev-server';
78
import addEntries from 'webpack-dev-server/lib/utils/addEntries';
89

10+
import baseConfig from '../config/base.config';
911
import webpackDevConfig from '../config/webpack.dev.babel';
1012

13+
const AUTO_OPEN_URL = 'http://' + baseConfig.dev.host + ':' + baseConfig.dev.port;
14+
1115
gulp.task('serve', function() {
1216
log.info('Webpack building.');
1317
addEntries(webpackDevConfig, webpackDevConfig.devServer);
@@ -16,5 +20,7 @@ gulp.task('serve', function() {
1620
if (error) {
1721
log.error('Webpack build error:', error);
1822
}
23+
log.info('Open:', AUTO_OPEN_URL);
24+
opn(AUTO_OPEN_URL);
1925
});
2026
});

0 commit comments

Comments
 (0)