vant/build/webpack.base.js
2019-08-30 16:05:28 +08:00

58 lines
1.2 KiB
JavaScript

const path = require('path');
const { VueLoaderPlugin } = require('vue-loader');
module.exports = {
mode: 'development',
resolve: {
extensions: ['.js', '.ts', '.tsx', '.vue', '.less']
},
module: {
rules: [
{
test: /\.vue$/,
use: [
{
loader: 'vue-loader',
options: {
compilerOptions: {
preserveWhitespace: false
}
}
}
]
},
{
test: /\.(js|ts|tsx)$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
// enable sub-packages to find babel config
options: {
rootMode: 'upward'
}
}
},
{
test: /\.less$/,
sideEffects: true,
use: [
'style-loader',
'css-loader',
'postcss-loader',
{
loader: 'less-loader',
options: {
paths: [path.resolve(__dirname, 'node_modules')]
}
}
]
},
{
test: /\.md$/,
use: ['vue-loader', '@vant/markdown-loader']
}
]
},
plugins: [new VueLoaderPlugin()]
};