forked from ninecat-ui/ninecat-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.dev.js
More file actions
86 lines (81 loc) · 2.09 KB
/
Copy pathwebpack.config.dev.js
File metadata and controls
86 lines (81 loc) · 2.09 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
'use strict'
const path = require('path')
const webpack = require('webpack')
const merge = require('webpack-merge')
const baseConfig = require('./webpack.config.base')
const FriendlyErrorsWebpackPlugin = require('friendly-errors-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const HOST = 'localhost'
const PORT = 8081
module.exports = merge(baseConfig, {
mode: 'development',
entry: path.resolve(__dirname, '../doc/index.js'),
devServer: {
clientLogLevel: 'warning',
hot: true,
contentBase: 'dist',
compress: true,
host: HOST,
port: PORT,
open: true,
overlay: { warnings: false, errors: true },
publicPath: '/',
quiet: true
},
module: {
rules: [
{
test: /\.css$/,
use: [
'vue-style-loader',
'css-loader'
]
}, {
test: /\.styl(us)?$/,
use: [
'vue-style-loader',
'css-loader',
'stylus-loader'
]
}, {
test: /\.scss$/,
use: [
'vue-style-loader',
'css-loader',
'sass-loader'
]
}
]
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new HtmlWebpackPlugin({
template: './doc/index.html',
filename: 'index.html',
favicon:'./doc/favicon.ico',
inject: true
}),
new FriendlyErrorsWebpackPlugin({
compilationSuccessInfo: {
messages: [
`
You application is running here http://${HOST}:${PORT}
Build:npm run prod
Publish npm:npm publish
`
],
notes: ['Some additionnal notes to be displayed unpon successful compilation']
},
onErrors: function (severity, errors) {
// You can listen to errors transformed and prioritized by the plugin
// severity can be 'error' or 'warning'
},
// should the console be cleared between each compilation?
// default is true
clearConsole: true,
// add formatters and transformers (see below)
additionalFormatters: [],
additionalTransformers: []
}),
]
})