|
|
@@ -10,19 +10,26 @@ const {
|
|
|
const port = process.env.port || 9527
|
|
|
|
|
|
const copyFiles = [
|
|
|
- { file: 'mediainfo.min.js', from: 'mediainfo.js/dist', to: '.' },
|
|
|
- { file: 'MediaInfoModule.wasm', from: 'mediainfo.js/dist', to: '.' },
|
|
|
- { file: 'spark-md5.min.js', from: 'spark-md5', to: '.' }
|
|
|
+ { file: 'mediainfo.min.js', from: resolveNodeDir('mediainfo.js/dist'), to: '.' },
|
|
|
+ { file: 'MediaInfoModule.wasm', from: resolveNodeDir('mediainfo.js/dist'), to: '.' },
|
|
|
+ { file: 'spark-md5.min.js', from: resolveNodeDir('spark-md5'), to: '.' },
|
|
|
+ { from: resolve(`platform/logo/${process.env.LOGO}`), to: './logo.png' }
|
|
|
]
|
|
|
|
|
|
function resolve (...dir) {
|
|
|
- return path.join(__dirname, ...dir)
|
|
|
+ return path.resolve(__dirname, ...dir)
|
|
|
+}
|
|
|
+
|
|
|
+function resolveNodeDir (...dir) {
|
|
|
+ return resolve('node_modules', ...dir)
|
|
|
}
|
|
|
|
|
|
function getCopyFiles () {
|
|
|
- return copyFiles.filter(({ file }) => !fs.existsSync(resolve('public', file))).map(({ file, from, to }) => {
|
|
|
- return { from: resolve('node_modules', from, file), to }
|
|
|
- })
|
|
|
+ return copyFiles
|
|
|
+ .filter(({ file }) => !file || !fs.existsSync(resolve('public', file)))
|
|
|
+ .map(({ file, from, to }) => {
|
|
|
+ return { from: file ? path.join(from, file) : from, to }
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
module.exports = {
|
|
|
@@ -46,7 +53,7 @@ module.exports = {
|
|
|
configureWebpack: {
|
|
|
// provide the app's title in webpack's name field, so that
|
|
|
// it can be accessed in index.html to inject the correct title.
|
|
|
- name: '浪潮屏媒安播云平台',
|
|
|
+ name: process.env.VUE_APP_NAME,
|
|
|
resolve: {
|
|
|
alias: {
|
|
|
'@': resolve('src')
|
|
|
@@ -114,6 +121,10 @@ module.exports = {
|
|
|
inline: /runtime\..*\.js$/
|
|
|
}])
|
|
|
.end()
|
|
|
+ // config
|
|
|
+ // .plugin('BundleAnalyzerPlugin')
|
|
|
+ // .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin)
|
|
|
+
|
|
|
config
|
|
|
.optimization.splitChunks({
|
|
|
chunks: 'all',
|