-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwebpack-docs.mjs
More file actions
106 lines (103 loc) · 2.36 KB
/
webpack-docs.mjs
File metadata and controls
106 lines (103 loc) · 2.36 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
98
99
100
101
102
103
104
105
106
import path from "path";
import { VueLoaderPlugin } from "vue-loader";
import MiniCssExtractPlugin from "mini-css-extract-plugin";
export default {
// target: "node",
mode: "development",
devtool: "inline-source-map",
devServer: {
static: {
directory: path.resolve("./docs/")
},
port: 8080
},
entry: {
script: [
// NOTE: HTML
path.resolve("./assets/html/index.html"),
// NOTE: script
path.resolve("./assets/script/script.js"),
// NOTE: layout and design
path.resolve("./assets/style/style.scss"),
// NOTE: icons and loader animation
path.resolve("./assets/icon/animation.css"),
path.resolve("./assets/icon/notation.css"),
// NOTE: favicon
path.resolve("./assets/img/favicon.png"),
path.resolve("./assets/img/favicon-32x32.png"),
path.resolve("./assets/img/apple-touch-icon.png"),
path.resolve("./assets/img/android-chrome-192x192.png"),
path.resolve("./assets/img/android-chrome-512x512.png"),
path.resolve("./assets/img/app.webmanifest")
]
},
output: {
path: path.resolve("./docs"),
publicPath: "/",
filename: "[name].js",
assetModuleFilename: "[name][hash][ext][query]"
},
resolve: {
extensions: [".js", ".vue", ".json", ".css", ".scss"],
alias: {
// vue$: "vue/dist/vue.esm.js",
// vue$: "vue/dist/vue.esm-browser.js",
// vue$: "vue/dist/vue.esm-bundler.js",
vue$: "vue/dist/vue.esm-browser.js"
}
},
externals: {
vue: "Vue",
"vue-router": "VueRouter"
},
optimization: {
// minimize: false
},
plugins: [
new VueLoaderPlugin(),
new MiniCssExtractPlugin({ filename: "style.css" })
],
module: {
rules: [
{
test: /\.vue$/,
loader: "vue-loader"
},
{
test: /\.exec\.js$/,
use: ["script-loader"]
},
{
test: /\.(sa|sc|c)ss$/i,
use: [MiniCssExtractPlugin.loader, "css-loader", "sass-loader"]
},
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: [
{
loader: "babel-loader",
options: {
presets: []
}
}
]
},
// {
// test: /\.(png|ico|jpg|gif|svg|eot|ttf|woff|woff2|webmanifest|html)$/,
// loader: 'file-loader',
// options: {
// name: '[name].[ext]',
// limit: 10000
// }
// }
{
test: /\.(png|ico|jpg|gif|svg|eot|ttf|woff|woff2|webmanifest|html)$/,
type: "asset/resource",
generator: {
filename: "[name][ext]"
}
}
]
}
};