Skip to content

Commit cda103e

Browse files
fix: build hanging when finished
1 parent 164ba65 commit cda103e

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

lib/bundlers/index.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ function dev(options) {
33
start(options)
44
}
55

6-
function build(options) {
6+
async function build(options) {
77
process.env.NODE_ENV = 'production'
88
// if (options.bundler === 'nollup') options.bundler = 'rollup'
99
options.bundler = 'rollup'
10-
start(options)
10+
await start(options)
1111
}
1212

13-
function start(options) {
13+
async function start(options) {
1414
const bundlers = {
1515
nollup: () => require('./rollup/nollup').startNollup,
1616
rollup: () => require('./rollup/rollup').startRollup,
@@ -20,17 +20,16 @@ function start(options) {
2020

2121
const bundler = bundlers[options.bundler]()
2222
bundler(options)
23-
startRoutify(options)
23+
await startRoutify(options)
2424
}
2525

26-
function startRoutify(_options) {
26+
async function startRoutify(_options) {
2727
const options = {
2828
routifyDir: '_roxi/.routify',
2929
dynamicImports: true,
3030
singleBuild: process.env.NODE_ENV === 'production'
3131
}
32-
33-
require(`@roxi/routify/lib/services/interface`).start(options)
32+
await require(`@roxi/routify/lib/services/interface`).start(options)
3433
}
3534

3635

lib/bundlers/rollup/configs/base.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export default function (options) {
4040
},
4141
plugins: [
4242
counter('copyToDist', 1) && copy({
43-
watch: 'public',
43+
watch: !production && 'public',
4444
targets: [
4545
{ src: [`${staticDir}/*`, "!*/(__index.html)"], dest: distDir },
4646
{ src: [`${staticDir}/__index.html`], dest: distDir, rename: '__app.html', transform },

lib/bundlers/rollup/rollup.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ const rollup = require('rollup')
22
const path = require('path');
33
const loadConfigFile = require('rollup/dist/loadConfigFile');
44

5-
const production = true
65

76

87
async function startRollup() {
8+
const production = process.env.NODE_ENV === 'production'
99
if (production) process.env.ROLLUP_WATCH = "true"
1010
// load the config file next to the current script;
1111
// the provided config object has the same effect as passing "--format es"

0 commit comments

Comments
 (0)