[Build] upgrade to webpack-serve (#1056)

This commit is contained in:
neverland 2018-05-13 09:04:58 +08:00 committed by GitHub
parent d2fe21d45d
commit 3b57e33654
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 585 additions and 648 deletions

View File

@ -14,14 +14,11 @@ module.exports = {
publicPath: '/',
chunkFilename: 'async_[name].js'
},
devServer: {
serve: {
open: true,
host: '0.0.0.0',
stats: 'errors-only',
historyApiFallback: {
rewrites: [
{ from: /^\/zanui\/vant\/examples/, to: '/examples.html' },
{ from: /^\/zanui\/vant/, to: '/index.html' }
]
dev: {
logLevel: 'warn'
}
},
resolve: {

View File

@ -11,8 +11,9 @@ import docConfig from './doc.config';
export default {
data() {
const path = location.pathname === '/' ? 'examples.html' : '/zanui/vant/examples';
return {
simulators: [`/zanui/vant/examples${location.hash}`],
simulators: [`${path}${location.hash}`],
demoURL: ''
};
},

View File

@ -14,7 +14,7 @@
],
"scripts": {
"bootstrap": "yarn || npm i && cd ./packages/vant-css/ && yarn || npm i && cd ../../",
"dev": "npm run build:file && webpack-dev-server --inline --config build/webpack.dev.js",
"dev": "npm run build:file && webpack-serve --config build/webpack.dev.js",
"build:file": "node build/bin/build-entry.js",
"build:components": "node build/bin/build-components.js --color",
"build:vant-css": "gulp build --gulpfile packages/vant-css/gulpfile.js --color",
@ -102,7 +102,7 @@
"vue-template-es2015-compiler": "^1.6.0",
"webpack": "^4.8.2",
"webpack-cli": "^2.0.15",
"webpack-dev-server": "3.1.4"
"webpack-serve": "^0.3.2"
},
"jest": {
"moduleFileExtensions": [

View File

@ -57,7 +57,7 @@ export default {
return {
minHour: 10,
maxHour: 20,
minDate: new Date(),
minDate: new Date(2018, 0, 1),
maxDate: new Date(2019, 10, 1),
currentDate1: new Date(2018, 0, 1),
currentDate2: null,

View File

@ -19,7 +19,11 @@ exports[`renders demo correctly 1`] = `
</div>
<div class="van-picker-column" style="height:220px;">
<ul style="transition:0ms;transform:translate3d(0, 88px, 0);line-height:44px;">
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">05</li>
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">01</li>
<li class="van-ellipsis van-picker-column__item">02</li>
<li class="van-ellipsis van-picker-column__item">03</li>
<li class="van-ellipsis van-picker-column__item">04</li>
<li class="van-ellipsis van-picker-column__item">05</li>
<li class="van-ellipsis van-picker-column__item">06</li>
<li class="van-ellipsis van-picker-column__item">07</li>
<li class="van-ellipsis van-picker-column__item">08</li>
@ -31,7 +35,18 @@ exports[`renders demo correctly 1`] = `
</div>
<div class="van-picker-column" style="height:220px;">
<ul style="transition:0ms;transform:translate3d(0, 88px, 0);line-height:44px;">
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">12</li>
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">01</li>
<li class="van-ellipsis van-picker-column__item">02</li>
<li class="van-ellipsis van-picker-column__item">03</li>
<li class="van-ellipsis van-picker-column__item">04</li>
<li class="van-ellipsis van-picker-column__item">05</li>
<li class="van-ellipsis van-picker-column__item">06</li>
<li class="van-ellipsis van-picker-column__item">07</li>
<li class="van-ellipsis van-picker-column__item">08</li>
<li class="van-ellipsis van-picker-column__item">09</li>
<li class="van-ellipsis van-picker-column__item">10</li>
<li class="van-ellipsis van-picker-column__item">11</li>
<li class="van-ellipsis van-picker-column__item">12</li>
<li class="van-ellipsis van-picker-column__item">13</li>
<li class="van-ellipsis van-picker-column__item">14</li>
<li class="van-ellipsis van-picker-column__item">15</li>
@ -175,7 +190,11 @@ exports[`renders demo correctly 1`] = `
</div>
<div class="van-picker-column" style="height:220px;">
<ul style="transition:0ms;transform:translate3d(0, 88px, 0);line-height:44px;">
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">05</li>
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">01</li>
<li class="van-ellipsis van-picker-column__item">02</li>
<li class="van-ellipsis van-picker-column__item">03</li>
<li class="van-ellipsis van-picker-column__item">04</li>
<li class="van-ellipsis van-picker-column__item">05</li>
<li class="van-ellipsis van-picker-column__item">06</li>
<li class="van-ellipsis van-picker-column__item">07</li>
<li class="van-ellipsis van-picker-column__item">08</li>
@ -187,7 +206,18 @@ exports[`renders demo correctly 1`] = `
</div>
<div class="van-picker-column" style="height:220px;">
<ul style="transition:0ms;transform:translate3d(0, 88px, 0);line-height:44px;">
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">12</li>
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">01</li>
<li class="van-ellipsis van-picker-column__item">02</li>
<li class="van-ellipsis van-picker-column__item">03</li>
<li class="van-ellipsis van-picker-column__item">04</li>
<li class="van-ellipsis van-picker-column__item">05</li>
<li class="van-ellipsis van-picker-column__item">06</li>
<li class="van-ellipsis van-picker-column__item">07</li>
<li class="van-ellipsis van-picker-column__item">08</li>
<li class="van-ellipsis van-picker-column__item">09</li>
<li class="van-ellipsis van-picker-column__item">10</li>
<li class="van-ellipsis van-picker-column__item">11</li>
<li class="van-ellipsis van-picker-column__item">12</li>
<li class="van-ellipsis van-picker-column__item">13</li>
<li class="van-ellipsis van-picker-column__item">14</li>
<li class="van-ellipsis van-picker-column__item">15</li>
@ -239,7 +269,11 @@ exports[`renders demo correctly 1`] = `
</div>
<div class="van-picker-column" style="height:220px;">
<ul style="transition:0ms;transform:translate3d(0, 88px, 0);line-height:44px;">
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">05</li>
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">01</li>
<li class="van-ellipsis van-picker-column__item">02</li>
<li class="van-ellipsis van-picker-column__item">03</li>
<li class="van-ellipsis van-picker-column__item">04</li>
<li class="van-ellipsis van-picker-column__item">05</li>
<li class="van-ellipsis van-picker-column__item">06</li>
<li class="van-ellipsis van-picker-column__item">07</li>
<li class="van-ellipsis van-picker-column__item">08</li>

1169
yarn.lock

File diff suppressed because it is too large Load Diff