-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.common.js
67 lines (66 loc) · 2.19 KB
/
webpack.common.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
const path = require('path');
const webpack = require("webpack");
const {VueLoaderPlugin} = require('vue-loader');
module.exports = {
entry: {
early_alert: './assets/ts/early_alert.ts'
},
output: {
filename: '[name]-bundle.js', // output bundle file name
path: path.resolve(__dirname, './static_global/js'), // path to our Django static directory
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
},
{
test: /.css$/,
use: [
'style-loader',
'css-loader',
]
},
{
test: /\.tsx?$/,
loader: 'ts-loader',
exclude: /node_modules/,
options: {
//Then there are settings for a ts-loader, which helps load the TypeScript with Vue.
//We also specified the appendTsSuffixTo: [/\.vue$/], option to ts-loader in our webpack.config.js file,
//which allows TypeScript to process the code extracted from a single file component.
//https://github.com/TypeStrong/ts-loader#appendtssuffixto
appendTsSuffixTo: [/\.vue$/],
}
},
{
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
type: 'asset/resource',
dependency: { not: ['url'] },
}
]
},
plugins: [
new VueLoaderPlugin(),
new webpack.DefinePlugin({
"__VUE_OPTIONS_API__": true,
"__VUE_PROD_DEVTOOLS__": false,
}),
// To avoid a warning in console, see https://github.com/intlify/vue-i18n-next/issues/789
new webpack.DefinePlugin({
'__VUE_I18N_FULL_INSTALL__': JSON.stringify(true),
'__VUE_I18N_LEGACY_API__': JSON.stringify(true),
'__INTLIFY_PROD_DEVTOOLS__': JSON.stringify(true)
})
],
resolve: {
extensions: ['.ts', '.js', '.json'],
alias: {
vue: "vue/dist/vue.esm-bundler.js"
}
},
stats: {
errorDetails: true,
}
};