-
Notifications
You must be signed in to change notification settings - Fork 8
/
webpack.config.js
56 lines (52 loc) · 1.24 KB
/
webpack.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
const path = require('path');
const HTMLWebpackPlugin = require('html-webpack-plugin');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
const rootDir = path.join(__dirname);
const config = {
mode: 'development',
entry: {
main: path.join(rootDir, 'src/main.js'),
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
},
// This will apply to both plain `.css` files and `<style>` block
// in `.vue` files
{
test: /\.css$/,
use: [
'vue-style-loader',
{
loader: 'css-loader',
options: {
modules: true,
camelCase: true,
localIdentName: '[name]__[local]__[hash:base64:5]',
},
},
],
exclude: /node_modules/,
},
// Vendor CSS from node_modules/, don't CSS-module them
{
test: /\.css$/,
use: ['style-loader', 'css-loader'],
include: /node_modules/,
},
],
},
plugins: [
new HTMLWebpackPlugin({
template: path.join(rootDir, 'src', 'index.html'),
hash: true,
}),
new VueLoaderPlugin(),
],
resolve: {
extensions: ['.js', '.vue', '.json'],
},
};
module.exports = config;