-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.base.config.js
95 lines (91 loc) · 1.99 KB
/
webpack.base.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const path = require('path');
const { VueLoaderPlugin } = require('vue-loader');
const styleLoader =
process.env.NODE_ENV !== 'production'
? 'vue-style-loader'
: MiniCssExtractPlugin.loader;
const sassLoader = {
loader: 'sass-loader',
options: {
implementation: require('sass'),
},
};
const baseConfig = {
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
},
{
test: /\.ts$/,
loader: 'awesome-typescript-loader',
exclude: /node_modules/,
options: {
appendTsSuffixTo: [/\.vue$/],
silent: true,
},
},
{
test: /\.js$/,
use: 'babel-loader',
},
{
test: /\.(sa|sc|c)ss$/,
oneOf: [
{
resourceQuery: /module/,
use: [
styleLoader,
{
loader: 'css-loader',
options: {
modules: {
localIdentName: '[local]_[hash:base64:5]',
},
},
},
sassLoader,
],
},
{
use: [styleLoader, 'css-loader', sassLoader],
},
],
},
{
test: /\.(png|woff|woff2|eot|ttf|svg)$/,
use: 'url-loader?limit=100000',
},
],
},
plugins: [
new VueLoaderPlugin(),
new MiniCssExtractPlugin({
filename: '[name].css',
}),
],
externals: {
// Unused drivers for knex.
sqlite3: 'sqlite3',
mariasql: 'mariasql',
mssql: 'mssql',
mysql: 'mysql',
oracle: 'oracle',
'strong-oracle': 'strong-oracle',
oracledb: 'oracledb',
},
resolve: {
extensions: ['.ts', '.js', '.vue', '.json'],
alias: {
vue$: 'vue/dist/vue.esm.js',
'@': path.join(__dirname, 'src'),
},
},
devtool: 'source-map',
performance: {
hints: false,
},
};
module.exports = { baseConfig };