forked from salesforce/cloudsplaining
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
58 lines (56 loc) · 1.96 KB
/
vue.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
const path = require('path');
let HtmlWebpackPlugin = require('html-webpack-plugin');
let HtmlWebpackInlineSourcePlugin = require('html-webpack-inline-source-plugin');
// const PreloadWebpackPlugin = require('preload-webpack-plugin');
module.exports = {
publicPath: '',
outputDir: path.resolve(__dirname, 'cloudsplaining', 'output', 'dist'),
filenameHashing: false,
pages: {
index: {
// entry for the page
entry: 'cloudsplaining/output/src/main.js',
// the source template
template: 'cloudsplaining/output/public/index.html',
// output as dist/index.html
filename: 'index.html',
chunks: ['chunk-vendors', 'index']
},
},
css: {extract: false},
chainWebpack: config => {
// config.output
// .filename = '[name].bundle.js';
if (process.env.NODE_ENV === 'development') {
config.plugins
.delete('preload')
.delete('prefetch');
}
config
.plugin('html-webpack-inline-source-plugin')
.use(HtmlWebpackInlineSourcePlugin)
config
.plugin('html-webpack-plugin')
.use(new HtmlWebpackPlugin({
inlineSource: '.(js|css)$', // embed all javascript and css inline
inject: true,
template: 'cloudsplaining/output/public/index.html', //template file to embed the source
title: 'Cloudsplaining report',
}
));
config.optimization
.splitChunks({
name: false,
chunks: 'async',
hidePathInfo: true,
});
config.module
.rule('md')
.test(/\.md$/)
.use('html-loader')
.loader("html-loader")
.end()
.use('markdown-loader')
.loader("markdown-loader")
}
}