-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
97 lines (92 loc) · 2.66 KB
/
webpack.config.js
File metadata and controls
97 lines (92 loc) · 2.66 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
const {VueLoaderPlugin} = require("vue-loader");
const htmlWebpackPlugin = require("html-webpack-plugin");
const path = require("path");
const CopyPlugin = require("copy-webpack-plugin");
const htmlPlugin = new htmlWebpackPlugin({
template: "./src/index.html",
filename: "index.html"
})
module.exports = {
entry: path.join(__dirname, "./src/main.js"),
output: {
path: path.join(__dirname, "./dist"),
filename: "app.js",
},
mode: "development",
module: {
rules: [
{
test: /\.vue$/,
use: [
{
loader: 'vue-loader',
options: {
}
},
{
loader: 'iview-loader',
options: {
prefix: false
}
}
]
},
{
test: /\.js$/,
loader: 'babel-loader'
},
// 它会应用到普通的 `.css` 文件
// 以及 `.vue` 文件中的 `<style>` 块
{
test: /\.css$/,
use: [
'vue-style-loader',
'css-loader'
]
},
{
test: /\.sass$/,
use: ["vue-style-loader", "css-loader", "sass-loader?indentedSyntax"]
},
{
test: /\.less$/,
use: [
"vue-style-loader",
"css-loader",
{
loader: "less-loader",
options: {
lessOptions: {
javascriptEnabled: true
}
}
}
]
},
],
},
resolve: {
extensions: [".js", ".ts", ".tsx", ".vue", ".json", ".css", ".node"],
alias: {
"@": path.join(__dirname, "./src"),
"@assets": path.join(__dirname, "./assets"),
}
},
plugins: [
htmlPlugin, new VueLoaderPlugin(), new CopyPlugin({
patterns: [
{
from: path.join(__dirname, "./data"),
to: path.join(__dirname, "./dist/data")
},
{
from: path.join(__dirname, "./assets"),
to: path.join(__dirname, "./dist/assets")
}
],
options: {
concurrency: 100
}
}),
]
}