Do not distribute backend source, export everything to commonjs
This commit is contained in:
parent
5869ba3ee3
commit
a753122290
@ -1,4 +1,4 @@
|
||||
export default {
|
||||
module.exports = {
|
||||
globals: {
|
||||
'ts-jest': {
|
||||
tsconfig: 'tsconfig.test.json',
|
||||
|
@ -11,7 +11,6 @@
|
||||
"access": "public"
|
||||
},
|
||||
"main": "dist/main.js",
|
||||
"type": "module",
|
||||
"types": "dist/index.d.ts",
|
||||
"scripts": {
|
||||
"test": "jest --verbose --runInBand",
|
||||
|
@ -1,7 +1,7 @@
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
export function copyRecursively(file, destination) {
|
||||
function copyRecursively(file, destination) {
|
||||
const target = path.join(destination, path.basename(file));
|
||||
if (fs.statSync(file).isDirectory()) {
|
||||
console.log('mkdir', target);
|
||||
@ -16,3 +16,7 @@ export function copyRecursively(file, destination) {
|
||||
fs.copyFileSync(file, target);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
copyRecursively,
|
||||
};
|
@ -1,4 +1,4 @@
|
||||
import fs from "fs";
|
||||
const fs = require('fs');
|
||||
|
||||
[
|
||||
'intermediates',
|
||||
|
@ -1,6 +1,6 @@
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
import {copyRecursively} from "./_functions.js";
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const {copyRecursively} = require('./_functions.js');
|
||||
|
||||
|
||||
[
|
||||
|
@ -1,6 +1,5 @@
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
import {copyRecursively} from "./_functions.js";
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
// These folders must exist for nodemon not to loop indefinitely.
|
||||
[
|
||||
@ -18,10 +17,5 @@ if (!fs.existsSync(symlink)) {
|
||||
fs.symlinkSync(path.resolve('dist/common'), symlink);
|
||||
}
|
||||
|
||||
// Copy all source files
|
||||
fs.readdirSync('src').forEach(file => {
|
||||
copyRecursively(path.join('src', file), 'dist');
|
||||
});
|
||||
|
||||
// Copy package.json
|
||||
fs.copyFileSync('package.json', 'dist/package.json');
|
||||
|
@ -20,7 +20,7 @@
|
||||
});
|
||||
|
||||
setRoutes(%routes%);
|
||||
setPublicUrl(%publicUrl%);
|
||||
setPublicUrl(`%publicUrl%`);
|
||||
|
||||
new View({
|
||||
hydrate: true,
|
||||
|
@ -3,6 +3,8 @@
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
|
||||
"module": "CommonJS",
|
||||
|
||||
"baseUrl": "../dist",
|
||||
"rootDir": "./",
|
||||
"sourceRoot": "./",
|
||||
|
Loading…
Reference in New Issue
Block a user