-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.config.debug.js
69 lines (68 loc) · 1.85 KB
/
webpack.config.debug.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
const path = require('path')
const CleanWebpackPlugin = require('clean-webpack-plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const VueLoaderPlugin = require('vue-loader/lib/plugin')
const entryPath = './markote/static/src'
const distPath = './markote/static/dist'
module.exports = {
entry: `${entryPath}/app`,
output: {
filename: '[name].[contenthash].js',
path: path.join(__dirname, distPath)
},
resolve: {
extensions: ['.ts', '.js', '.vue'],
alias: {
'vue$': 'vue/dist/vue.esm.js'
}
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader'
},
{
test: /\.ts$/,
loader: 'ts-loader',
exclude: /node_modules/,
options: {
appendTsSuffixTo: [/\.vue$/]
}
},
{
test: /\.css$/,
use: [
'vue-style-loader',
'css-loader'
]
},
{
test: /\.pug$/,
loader: 'pug-loader'
}
]
},
plugins: [
new CleanWebpackPlugin([distPath]),
new CopyWebpackPlugin([
{
from: './markote/static/images',
to: 'images'
}
]),
new HtmlWebpackPlugin({
filename: 'notes.html',
template: './markote/static/public/notes.pug'
}),
new HtmlWebpackPlugin({
inject: false,
filename: 'logout.html',
template: './markote/static/public/logout.pug'
}),
new VueLoaderPlugin()
],
devtool: 'source-map',
mode: 'development'
}