mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
58 lines
1.2 KiB
JavaScript
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()]
|
|
};
|