-
Notifications
You must be signed in to change notification settings - Fork 12
/
webpack.test.config.js
69 lines (66 loc) · 1.53 KB
/
webpack.test.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
* @LastEditors: zhanghengxin [email protected]
* @LastEditTime: 2023/7/31 上午11:03
* @FilePath: /CasaOS-UI/main/webpack.config.js
* @Description:
*
* Copyright (c) 2023 by IceWhale, All Rights Reserved.
*/
const nodeExternals = require('webpack-node-externals');
const path = require('path');
// const HtmlWebpackPlugin = require('html-webpack-plugin');
const {VueLoaderPlugin} = require('vue-loader');
module.exports = {
mode: 'development',
resolve: {
alias: {"@": path.resolve(__dirname, 'src')},
},
target: 'node',
externals: [nodeExternals()],
devtool: 'inline-cheap-module-source-map',
output: {
// https://v1.test-utils.vuejs.org/zh/installation/testing-single-file-components-with-mocha-webpack.html
// 在源码表中使用绝对路径 (对于在 IDE 中调试时很重要)
devtoolModuleFilenameTemplate: '[absolute-resource-path]',
devtoolFallbackModuleFilenameTemplate: '[absolute-resource-path]?[hash]',
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader'
},
{
test: /\.spec\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env']
}
}
},
{
test: /\.css$/,
use: [
'vue-style-loader',
'css-loader'
]
},
{
test: /\.(png|jpe?g|gif)$/i,
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: 'images/'
}
}
]
},
plugins: [
// new HtmlWebpackPlugin({
// template: './public/index.html'
// }),
new VueLoaderPlugin()
]
}