mirror of
https://github.com/youzan/vant.git
synced 2025-10-17 08:37:23 +00:00
[Improvement] upgrade to webpack 4 (#693)
This commit is contained in:
@@ -4,6 +4,7 @@ const ProgressBarPlugin = require('progress-bar-webpack-plugin');
|
||||
|
||||
function getWebpackConfig(testFileName) {
|
||||
return {
|
||||
mode: 'development',
|
||||
output: {
|
||||
path: path.resolve(process.cwd(), 'dist'),
|
||||
publicPath: '/dist/',
|
||||
@@ -18,7 +19,7 @@ function getWebpackConfig(testFileName) {
|
||||
options: {
|
||||
babel: {
|
||||
presets: ['env'],
|
||||
plugins: ['transform-runtime']
|
||||
plugins: ['transform-runtime', 'transform-object-rest-spread']
|
||||
},
|
||||
vue: {
|
||||
autoprefixer: false,
|
||||
@@ -35,7 +36,7 @@ function getWebpackConfig(testFileName) {
|
||||
stats: 'errors-only',
|
||||
resolve: {
|
||||
modules: [path.resolve(process.cwd(), 'node_modules'), 'node_modules'],
|
||||
extensions: ['.js', '.json', '.vue', '.css'],
|
||||
extensions: ['.js', '.vue', '.css'],
|
||||
alias: {
|
||||
src: path.resolve(process.cwd(), 'src'),
|
||||
packages: path.resolve(process.cwd(), 'packages'),
|
||||
@@ -48,12 +49,12 @@ function getWebpackConfig(testFileName) {
|
||||
enforce: 'pre',
|
||||
test: /\.js$/,
|
||||
exclude: /node_modules|vue-router\/|vue-loader\/|docs|test|src\/index|src\/utils|src\/mixins|packages\/swipe/,
|
||||
use: ['isparta-loader']
|
||||
use: 'isparta-loader'
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
exclude: /node_modules|vue-router\/|vue-loader\//,
|
||||
use: ['babel-loader']
|
||||
use: 'babel-loader'
|
||||
},
|
||||
{
|
||||
test: /\.(css|pcss)$/,
|
||||
@@ -111,8 +112,7 @@ function getWebpackConfig(testFileName) {
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
devtool: '#inline-source-map'
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { mount } from 'avoriaz';
|
||||
import AddressEdit from 'packages/address-edit';
|
||||
import AddressDetail from 'packages/address-edit/Detail';
|
||||
import areaList from '../../docs/demos/mock/area.json';
|
||||
import areaList from '../../docs/demos/mock/area';
|
||||
|
||||
describe('AddressEdit', () => {
|
||||
let wrapper;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import Area from 'packages/area';
|
||||
import { mount } from 'avoriaz';
|
||||
import areaList from '../../docs/demos/mock/area.json';
|
||||
import areaList from '../../docs/demos/mock/area';
|
||||
|
||||
describe('Area', () => {
|
||||
let wrapper;
|
||||
|
@@ -49,7 +49,7 @@ describe('Utils', () => {
|
||||
raf(spy);
|
||||
|
||||
setTimeout(() => {
|
||||
expect(spy.calledOnce).to.be.true;
|
||||
expect(spy.called).to.be.true;
|
||||
cancel(1);
|
||||
done();
|
||||
}, 50);
|
||||
|
Reference in New Issue
Block a user