Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions builders/spa.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = async function spa(folder = 'spa') {

const dir = process.cwd();
const application = require(`${dir}/.production/server`).default
const { existsSync, mkdirSync, writeFileSync, copySync, rmSync } = require('fs-extra');
const { existsSync, mkdirSync, writeFileSync, copySync, removeSync } = require('fs-extra');
const path = `${dir}/${folder}`;

async function copy(url, file) {
Expand All @@ -19,7 +19,7 @@ module.exports = async function spa(folder = 'spa') {

console.log()
if (existsSync(path)) {
rmSync(path, { recursive: true });
removeSync(path);
}
mkdirSync(path)
console.log(` ⚙️ /public/`)
Expand Down
4 changes: 2 additions & 2 deletions builders/ssg.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = async function ssg(folder = 'ssg') {
const dir = process.cwd();
const application = require(`${dir}/.production/server`).default;
const { resolve } = require('path')
const { existsSync, mkdirSync, writeFileSync, copySync, rmSync } = require('fs-extra');
const { existsSync, mkdirSync, writeFileSync, copySync, removeSync } = require('fs-extra');

function path(file = '') {
const target = file.startsWith('/') ? file.slice(1) : file;
Expand Down Expand Up @@ -85,7 +85,7 @@ module.exports = async function ssg(folder = 'ssg') {

console.log()
if (existsSync(path())) {
rmSync(path(), { recursive: true });
removeSync(path());
}
mkdirSync(path())
console.log(` ⚙️ /public/`)
Expand Down
2 changes: 1 addition & 1 deletion scripts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function build({ input, output, mode = 'ssr' }) {
console.log(` 🚀️ Building your application in ${mode} mode...`);
compiler.run((error, stats) => {
logTrace(stats, false);
if (stats.hasErrors()) return;
if (stats.hasErrors()) process.exit(1);
require(`../builders/${mode}`)(output);
});
}
Expand Down
2 changes: 1 addition & 1 deletion tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"scripts": {
"start": "npx nullstack start --input=./tests --port=6969",
"build": "npx nullstack build --input=./tests --mode=ssr",
"test": "jest --testTimeout=20000",
"test": "npm run build && jest --testTimeout=20000",
"script": "node src/scripts/run.js"
},
"dependencies": {
Expand Down
3 changes: 0 additions & 3 deletions tests/src/Purge.test.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
const { readFileSync } = require('fs');
const { promisify } = require('util');
const exec = promisify(require('child_process').exec);

let css;

const unused = '.unused'

beforeAll(async () => {
await exec('npm run build');
css = readFileSync('.production/client.css', 'utf-8')
});

Expand Down