-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
75 lines (73 loc) · 2.2 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
69
70
71
72
73
74
75
'use strict'
const path = require("path")
const webpack = require('webpack')
const BundleTracker = require('webpack-bundle-tracker')
const VueLoaderPlugin = require('vue-loader/lib/plugin')
const CleanWebpackPlugin = require('clean-webpack-plugin')
module.exports = {
mode: 'development',
context: __dirname,
entry: {
admin_jobs: './data_aggregator/static/vue/admin/jobs.js',
admin_job_detail: './data_aggregator/static/vue/admin/job_detail.js',
admin_metadata: './data_aggregator/static/vue/admin/metadata.js',
api_analytics: './data_aggregator/static/vue/api/analytics.js',
},
output: {
path: path.resolve('./data_aggregator/static/data_aggregator/bundles/'),
filename: "[name]-[hash].js",
},
plugins: [
new CleanWebpackPlugin(),
new BundleTracker({
filename: './data_aggregator/static/webpack-stats.json'
}),
new VueLoaderPlugin(),
],
module: {
rules: [{
test: /\.vue$/,
loader: 'vue-loader'
},
{
test: /\.s[ac]ss$/,
sideEffects: true,
use: [
// Creates `style` nodes from JS strings
"style-loader",
// Translates CSS into CommonJS
"css-loader",
// Compiles Sass to CSS
"sass-loader",
],
},
{
test: /\.css$/,
sideEffects: true,
use: [
// Creates `style` nodes from JS strings
"style-loader",
// Translates CSS into CommonJS
"css-loader",
],
},
{
test: /\.(png|svg|jpg|gif|woff|woff2|eot|ttf|svg)$/,
use: ['file-loader']
},
]
},
resolve: {
extensions: ['.js', '.vue'],
alias: {
'vue$': 'vue/dist/vue.esm.js'
}
}
}
if (process.env.BUNDLE_ANALYZER === "True") {
module.exports.plugins.push(
new BundleAnalyzerPlugin({
analyzerHost: '0.0.0.0',
})
);
}