aboutsummaryrefslogtreecommitdiff
path: root/webpack.dev.js
blob: 1137eb5bb7514db01b707af11de31153469e3b0b (plain)
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
const webpack = require('webpack');
const { merge } = require('webpack-merge');
const common = require('./webpack.common.js');
const CopyPlugin = require('copy-webpack-plugin');
const WebpackNotifierPlugin = require('webpack-notifier');
const path = require('path');

const statusesPaths = {
    success: path.join(__dirname, 'public/assets/images/favicon-64x64.png'),
    error: path.join(__dirname, 'public/assets/images/virtual.png'),
};

module.exports = merge(common, {
    mode: 'development',
    devtool: false,
    plugins: [
        new CopyPlugin({
            patterns: [
                {
                    from: './node_modules/vue/dist/vue.global.js',
                    to: './javascripts/vue.global.prod.js',
                },
                {
                    from: './node_modules/vuex/dist/vuex.global.js',
                    to: './javascripts/vuex.global.prod.js',
                },
            ],
        }),
        new webpack.WatchIgnorePlugin({
            paths:[
                /\.d\.[cm]ts$/
            ]
        }),
        new webpack.DefinePlugin({
            __VUE_OPTIONS_API__: 'true',
            __VUE_PROD_DEVTOOLS__: 'true',
            __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: 'true'
        }),
        new WebpackNotifierPlugin({
            appID: 'Stud.IP Webpack',
            title: function (params) {
                return `Build status is ${params.status}`;
            },
            timeout: false,
            hint: process.platform === 'linux' ? 'int:transient:1' : undefined,
            excludeWarnings: true,
            contentImage: statusesPaths,
        }),
        new webpack.SourceMapDevToolPlugin({
            test: /\.css$/i,
            filename: null,
            append: '/*# sourceMappingURL=[url] */',
        }),
    ],
});