mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-14 03:54:46 +00:00
always write to .sapper, not templates, since we cant guarantee fs access
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const { dest, main_built, server_routes, dev } = require('../config.js');
|
||||
const { dest, server_routes, dev } = require('../config.js');
|
||||
|
||||
module.exports = function create_app(src, dest, routes, options) {
|
||||
function create_client_main() {
|
||||
@@ -23,11 +23,13 @@ module.exports = function create_app(src, dest, routes, options) {
|
||||
.replace(/__routes__/g, code)
|
||||
.replace(/__dev__/g, String(dev));
|
||||
|
||||
fs.writeFileSync(main_built, main);
|
||||
const file = path.resolve(dest, 'main.js');
|
||||
|
||||
fs.writeFileSync(file, main);
|
||||
|
||||
// need to fudge the mtime, because webpack is soft in the head
|
||||
const stats = fs.statSync(main_built);
|
||||
fs.utimesSync(main_built, stats.atimeMs - 999999, stats.mtimeMs - 999999);
|
||||
const stats = fs.statSync(file);
|
||||
fs.utimesSync(file, stats.atimeMs - 999999, stats.mtimeMs - 999999);
|
||||
}
|
||||
|
||||
function create_server_routes() {
|
||||
|
||||
Reference in New Issue
Block a user