mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-19 09:14:27 +08:00
init frontend framework
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
module.exports = {
|
||||
pages: {
|
||||
desktop: {
|
||||
entry: 'src/desktop/main.js',
|
||||
template: 'src/desktop/public/index.html',
|
||||
filename: 'desktop.html',
|
||||
chunks: ['vendors-common-bundle', 'vendors-desktop-bundle', 'common-bundle', 'desktop']
|
||||
},
|
||||
mobile: {
|
||||
entry: 'src/mobile/main.js',
|
||||
template: 'src/mobile/public/index.html',
|
||||
filename: 'mobile.html',
|
||||
chunks: ['vendors-common-bundle', 'vendors-mobile-bundle', 'common-bundle', 'mobile']
|
||||
}
|
||||
},
|
||||
publicPath: '',
|
||||
productionSourceMap: false,
|
||||
chainWebpack: config => {
|
||||
config.optimization.splitChunks({
|
||||
cacheGroups: {
|
||||
'vendors-common-bundle': {
|
||||
name: 'vendors-common-bundle',
|
||||
test: /[\\/]node_modules[\\/]/,
|
||||
chunks: 'initial',
|
||||
priority: 10,
|
||||
minChunks: 2
|
||||
},
|
||||
'vendors-bundle': {
|
||||
name: (module, chunks, cacheGroupKey) => {
|
||||
const allChunksNames = chunks.map((item) => item.name).join('-');
|
||||
return `vendors-${allChunksNames}-bundle`;
|
||||
},
|
||||
test: /[\\/]node_modules[\\/]/,
|
||||
chunks: 'initial',
|
||||
priority: 5,
|
||||
minChunks: 1
|
||||
},
|
||||
'common-bundle': {
|
||||
name: 'common-bundle',
|
||||
chunks: 'initial',
|
||||
priority: 1,
|
||||
minChunks: 2
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
devServer: {
|
||||
host: '0.0.0.0',
|
||||
port: 8081,
|
||||
disableHostCheck: true,
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://127.0.0.1:8080/',
|
||||
changeOrigin: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user