mirror of
https://github.com/marktext/marktext.git
synced 2025-05-02 22:10:24 +08:00
update: build process
This commit is contained in:
parent
7494bb3223
commit
fe65e13029
@ -3,9 +3,10 @@
|
|||||||
process.env.NODE_ENV = 'production'
|
process.env.NODE_ENV = 'production'
|
||||||
|
|
||||||
const { say } = require('cfonts')
|
const { say } = require('cfonts')
|
||||||
|
const path = require('path')
|
||||||
const chalk = require('chalk')
|
const chalk = require('chalk')
|
||||||
const del = require('del')
|
const del = require('del')
|
||||||
const { spawn } = require('child_process')
|
const fs = require('fs-extra')
|
||||||
const webpack = require('webpack')
|
const webpack = require('webpack')
|
||||||
const Multispinner = require('multispinner')
|
const Multispinner = require('multispinner')
|
||||||
|
|
||||||
@ -29,10 +30,15 @@ function clean () {
|
|||||||
process.exit()
|
process.exit()
|
||||||
}
|
}
|
||||||
|
|
||||||
function build () {
|
async function build () {
|
||||||
greeting()
|
greeting()
|
||||||
|
|
||||||
del.sync(['dist/electron/*', '!.gitkeep'])
|
del.sync(['dist/electron/*', '!.gitkeep'])
|
||||||
|
del.sync(['static/themes/*'])
|
||||||
|
|
||||||
|
const from = path.resolve(__dirname, '../src/muya/themes')
|
||||||
|
const to = path.resolve(__dirname, '../static/themes')
|
||||||
|
await fs.copy(from, to)
|
||||||
|
|
||||||
const tasks = ['main', 'renderer']
|
const tasks = ['main', 'renderer']
|
||||||
const m = new Multispinner(tasks, {
|
const m = new Multispinner(tasks, {
|
||||||
|
@ -193,11 +193,6 @@ if (proMode) {
|
|||||||
chunkFilename: '[id].[hash].css'
|
chunkFilename: '[id].[hash].css'
|
||||||
}),
|
}),
|
||||||
new CopyWebpackPlugin([
|
new CopyWebpackPlugin([
|
||||||
{
|
|
||||||
from: path.resolve(__dirname, '../src/muya/themes'),
|
|
||||||
to: path.join(__dirname, '../static/themes'),
|
|
||||||
force: true
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
from: path.join(__dirname, '../static'),
|
from: path.join(__dirname, '../static'),
|
||||||
to: path.join(__dirname, '../dist/electron/static'),
|
to: path.join(__dirname, '../dist/electron/static'),
|
||||||
|
Loading…
Reference in New Issue
Block a user