合并打包的页面文件
parent
a5ec36bf89
commit
ebd6ff36ed
|
@ -6,7 +6,7 @@ module.exports = {
|
||||||
output: {
|
output: {
|
||||||
filename: '[name].js',
|
filename: '[name].js',
|
||||||
libraryTarget: 'commonjs2',
|
libraryTarget: 'commonjs2',
|
||||||
path: path.join(__dirname, '../../dist/electron'),
|
path: path.join(__dirname, '../../dist'),
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
|
|
|
@ -26,11 +26,11 @@ module.exports = merge(baseConfig, {
|
||||||
patterns: [
|
patterns: [
|
||||||
{
|
{
|
||||||
from: path.join(__dirname, '../../src/main/modules/userApi/renderer'),
|
from: path.join(__dirname, '../../src/main/modules/userApi/renderer'),
|
||||||
to: path.join(__dirname, '../../dist/electron/userApi/renderer'),
|
to: path.join(__dirname, '../../dist/userApi/renderer'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
from: path.join(__dirname, '../../src/main/modules/userApi/rendererEvent/name.js'),
|
from: path.join(__dirname, '../../src/main/modules/userApi/rendererEvent/name.js'),
|
||||||
to: path.join(__dirname, '../../dist/electron/userApi/rendererEvent/name.js'),
|
to: path.join(__dirname, '../../dist/userApi/rendererEvent/name.js'),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -14,7 +14,7 @@ const okayLog = chalk.bgGreen.white(' OKAY ') + ' '
|
||||||
|
|
||||||
|
|
||||||
function build() {
|
function build() {
|
||||||
del.sync(['dist/electron/**', 'build/**'])
|
del.sync(['dist/**', 'build/**'])
|
||||||
|
|
||||||
const spinners = new Spinnies({ color: 'blue' })
|
const spinners = new Spinnies({ color: 'blue' })
|
||||||
spinners.add('main', { text: 'main building' })
|
spinners.add('main', { text: 'main building' })
|
||||||
|
|
|
@ -17,7 +17,7 @@ module.exports = {
|
||||||
output: {
|
output: {
|
||||||
filename: '[name].js',
|
filename: '[name].js',
|
||||||
libraryTarget: 'commonjs2',
|
libraryTarget: 'commonjs2',
|
||||||
path: path.join(__dirname, '../../dist/electron'),
|
path: path.join(__dirname, '../../dist'),
|
||||||
publicPath: 'auto',
|
publicPath: 'auto',
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
const path = require('path')
|
// const path = require('path')
|
||||||
const webpack = require('webpack')
|
const webpack = require('webpack')
|
||||||
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin')
|
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin')
|
||||||
const TerserPlugin = require('terser-webpack-plugin')
|
const TerserPlugin = require('terser-webpack-plugin')
|
||||||
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
|
||||||
const { merge } = require('webpack-merge')
|
const { merge } = require('webpack-merge')
|
||||||
|
|
||||||
const baseConfig = require('./webpack.config.base')
|
const baseConfig = require('./webpack.config.base')
|
||||||
|
@ -20,14 +19,6 @@ module.exports = merge(baseConfig, {
|
||||||
...Object.keys(dependencies || {}).filter(d => !whiteListedModules.includes(d)),
|
...Object.keys(dependencies || {}).filter(d => !whiteListedModules.includes(d)),
|
||||||
],
|
],
|
||||||
plugins: [
|
plugins: [
|
||||||
new CopyWebpackPlugin({
|
|
||||||
patterns: [
|
|
||||||
{
|
|
||||||
from: path.join(__dirname, '../../src/static'),
|
|
||||||
to: path.join(__dirname, '../../dist/electron/static'),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}),
|
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
'process.env': {
|
'process.env': {
|
||||||
NODE_ENV: '"production"',
|
NODE_ENV: '"production"',
|
||||||
|
|
|
@ -17,7 +17,7 @@ module.exports = {
|
||||||
output: {
|
output: {
|
||||||
filename: '[name].js',
|
filename: '[name].js',
|
||||||
libraryTarget: 'commonjs2',
|
libraryTarget: 'commonjs2',
|
||||||
path: path.join(__dirname, '../../dist/electron'),
|
path: path.join(__dirname, '../../dist'),
|
||||||
publicPath: 'auto',
|
publicPath: 'auto',
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
|
|
|
@ -23,7 +23,7 @@ module.exports = merge(baseConfig, {
|
||||||
patterns: [
|
patterns: [
|
||||||
{
|
{
|
||||||
from: path.join(__dirname, '../../src/static'),
|
from: path.join(__dirname, '../../src/static'),
|
||||||
to: path.join(__dirname, '../../dist/electron/static'),
|
to: path.join(__dirname, '../../dist/static'),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -151,7 +151,7 @@ function startElectron() {
|
||||||
let args = [
|
let args = [
|
||||||
'--inspect=5858',
|
'--inspect=5858',
|
||||||
// 'NODE_ENV=development',
|
// 'NODE_ENV=development',
|
||||||
path.join(__dirname, '../dist/electron/main.js'),
|
path.join(__dirname, '../dist/main.js'),
|
||||||
]
|
]
|
||||||
|
|
||||||
// detect yarn or npm and process commandline args accordingly
|
// detect yarn or npm and process commandline args accordingly
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"name": "lx-music-desktop",
|
"name": "lx-music-desktop",
|
||||||
"version": "1.20.1-beta",
|
"version": "1.20.1-beta",
|
||||||
"description": "一个免费的音乐查找助手",
|
"description": "一个免费的音乐查找助手",
|
||||||
"main": "./dist/electron/main.js",
|
"main": "./dist/main.js",
|
||||||
"productName": "lx-music-desktop",
|
"productName": "lx-music-desktop",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"pack": "node build-config/pack.js && npm run pack:win:setup:x64",
|
"pack": "node build-config/pack.js && npm run pack:win:setup:x64",
|
||||||
|
@ -57,7 +57,7 @@
|
||||||
"publish:linux:rpm": "cross-env ARCH=x64 electron-builder -l=rpm --x64 -p onTagOrDraft",
|
"publish:linux:rpm": "cross-env ARCH=x64 electron-builder -l=rpm --x64 -p onTagOrDraft",
|
||||||
"publish:linux:pacman": "cross-env ARCH=x64 electron-builder -l=pacman --x64 -p onTagOrDraft",
|
"publish:linux:pacman": "cross-env ARCH=x64 electron-builder -l=pacman --x64 -p onTagOrDraft",
|
||||||
"dev": "node build-config/runner-dev.js",
|
"dev": "node build-config/runner-dev.js",
|
||||||
"clean:electron": "rimraf dist/electron",
|
"clean:electron": "rimraf dist",
|
||||||
"clean": "rimraf dist && rimraf build",
|
"clean": "rimraf dist && rimraf build",
|
||||||
"build:src": "node build-config/pack.js",
|
"build:src": "node build-config/pack.js",
|
||||||
"build:main": "cross-env NODE_ENV=production webpack --config build-config/main/webpack.config.prod.js --progress",
|
"build:main": "cross-env NODE_ENV=production webpack --config build-config/main/webpack.config.prod.js --progress",
|
||||||
|
@ -89,7 +89,7 @@
|
||||||
"output": "./build"
|
"output": "./build"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"dist/electron/**/*"
|
"dist/**/*"
|
||||||
],
|
],
|
||||||
"asar": {
|
"asar": {
|
||||||
"smartUnpack": false
|
"smartUnpack": false
|
||||||
|
|
|
@ -10,7 +10,7 @@ function route(path, view, name, meta, props) {
|
||||||
path,
|
path,
|
||||||
meta,
|
meta,
|
||||||
props,
|
props,
|
||||||
component: (resovle) => import(`../views/${view}.vue`).then(resovle),
|
component: require(`../views/${view}.vue`).default,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue