-
Notifications
You must be signed in to change notification settings - Fork 4
/
webpack.config.js
68 lines (67 loc) · 2.87 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
57
58
59
60
61
62
63
64
65
66
67
68
const path = require('path');
const MomentLocalesPlugin = require('moment-locales-webpack-plugin');
const MomentTimezoneDataPlugin = require('moment-timezone-data-webpack-plugin');
module.exports = {
resolve: {
extensions: ['.js', '.json', '.vue'],
alias: {
'layouts': path.resolve(process.cwd(), 'resources/js/layouts'),
'pages': path.resolve(process.cwd(), 'resources/js/pages'),
'services': path.resolve(process.cwd(), 'resources/js/services'),
'plugins': path.resolve(process.cwd(), 'resources/js/plugins'),
'support': path.resolve(process.cwd(), 'resources/js/support'),
'templates': path.resolve(process.cwd(), 'resources/js/templates'),
'widgets': path.resolve(process.cwd(), 'resources/js/widgets'),
'helpers': path.resolve(process.cwd(), 'resources/js/helpers')
}
},
module: {
rules: [
{
test: /\.m?js$/,
exclude: /node_modules\/(?!(@morningtrain\/.*|mt-.*|quill-mention)\/).*/,
use: {
loader: 'babel-loader',
options: {
presets: [
"@babel/react"
],
plugins: [
"@babel/plugin-syntax-dynamic-import",
"babel-plugin-webpack-alias",
"@babel/plugin-transform-arrow-functions",
"@babel/plugin-proposal-export-namespace-from",
"@babel/plugin-proposal-export-default-from",
["@babel/plugin-proposal-decorators", { "legacy": true }],
["@babel/plugin-proposal-class-properties", { "loose" : true }],
["@babel/plugin-transform-spread", { "loose" : false }],
"@babel/plugin-transform-destructuring",
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-transform-shorthand-properties",
"@babel/plugin-transform-parameters",
"@babel/plugin-transform-template-literals",
"@babel/plugin-transform-classes",
"@babel/plugin-proposal-optional-chaining",
"transform-es2015-computed-properties",
]
}
}
}
]
},
optimization: {
splitChunks: {
name: 'vendor',
minChunks: 2
}
},
plugins: [
new MomentLocalesPlugin({
localesToKeep: ['en', 'da'],
}),
new MomentTimezoneDataPlugin({
startYear: 2010,
endYear: ((new Date()).getFullYear())+10
}),
]
};