forked from glpi-project/glpi
-
Notifications
You must be signed in to change notification settings - Fork 3
/
.vue.webpack.config.js
64 lines (61 loc) · 1.71 KB
/
.vue.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
57
58
59
60
61
62
63
64
const webpack = require('webpack');
const path = require('path');
const fs = require("fs");
const VueLoaderPlugin = require('vue-loader').VueLoaderPlugin;
const config = {
entry: {
'vue': './js/src/vue/app.js',
},
output: {
filename: 'app.js',
chunkFilename: "[name].js",
path: path.resolve(__dirname, 'public/build/vue'),
publicPath: '/public/build/vue/',
asyncChunks: true,
clean: true,
},
module: {
rules: [
{
// Vue SFC
test: /\.vue$/,
loader: 'vue-loader'
},
{
// Build styles
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
]
},
plugins: [
new webpack.BannerPlugin(fs.readFileSync(path.resolve(__dirname, 'tools/HEADER'), 'utf8').trim()),
new VueLoaderPlugin(), // Vue SFC support
new webpack.ProvidePlugin(
{
process: 'process/browser'
}
),
new webpack.DefinePlugin({
__VUE_OPTIONS_API__: false, // We will only use composition API
__VUE_PROD_DEVTOOLS__: false,
}),
],
resolve: {
fallback: {
'process/browser': require.resolve('process/browser.js')
},
},
mode: 'none', // Force 'none' mode, as optimizations will be done on release process
devtool: 'source-map', // Add sourcemap to files
stats: {
// Limit verbosity to only usefull information
all: false,
errors: true,
errorDetails: true,
warnings: true,
entrypoints: true,
timings: true,
}
};
module.exports = config