save WIP
not really getting the feel for this, will continue later, need to really learn how this works
This commit is contained in:
56
vue/vue.config.js
Normal file
56
vue/vue.config.js
Normal file
@ -0,0 +1,56 @@
|
||||
const BundleTracker = require("webpack-bundle-tracker");
|
||||
|
||||
const pages = {
|
||||
'vue_app_01': {
|
||||
entry: './src/main.js',
|
||||
chunks: ['chunk-vendors']
|
||||
},
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
pages: pages,
|
||||
filenameHashing: false,
|
||||
productionSourceMap: false,
|
||||
publicPath: process.env.NODE_ENV === 'production'
|
||||
? ''
|
||||
: 'http://localhost:8080/',
|
||||
outputDir: '../cookbook/static/vue/',
|
||||
|
||||
chainWebpack: config => {
|
||||
|
||||
config.optimization
|
||||
.splitChunks({
|
||||
cacheGroups: {
|
||||
vendor: {
|
||||
test: /[\\/]node_modules[\\/]/,
|
||||
name: "chunk-vendors",
|
||||
chunks: "all",
|
||||
priority: 1
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Object.keys(pages).forEach(page => {
|
||||
config.plugins.delete(`html-${page}`);
|
||||
config.plugins.delete(`preload-${page}`);
|
||||
config.plugins.delete(`prefetch-${page}`);
|
||||
})
|
||||
|
||||
config
|
||||
.plugin('BundleTracker')
|
||||
.use(BundleTracker, [{filename: '../vue/webpack-stats.json'}]);
|
||||
|
||||
config.resolve.alias
|
||||
.set('__STATIC__', 'static')
|
||||
|
||||
config.devServer
|
||||
.public('http://localhost:8080')
|
||||
.host('localhost')
|
||||
.port(8080)
|
||||
.hotOnly(true)
|
||||
.watchOptions({poll: 1000})
|
||||
.https(false)
|
||||
.headers({"Access-Control-Allow-Origin": ["*"]})
|
||||
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user