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: {
|
globals: {
|
||||||
'ts-jest': {
|
'ts-jest': {
|
||||||
tsconfig: 'tsconfig.test.json',
|
tsconfig: 'tsconfig.test.json',
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
"access": "public"
|
"access": "public"
|
||||||
},
|
},
|
||||||
"main": "dist/main.js",
|
"main": "dist/main.js",
|
||||||
"type": "module",
|
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "jest --verbose --runInBand",
|
"test": "jest --verbose --runInBand",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import fs from "fs";
|
const fs = require('fs');
|
||||||
import path from "path";
|
const path = require('path');
|
||||||
|
|
||||||
export function copyRecursively(file, destination) {
|
function copyRecursively(file, destination) {
|
||||||
const target = path.join(destination, path.basename(file));
|
const target = path.join(destination, path.basename(file));
|
||||||
if (fs.statSync(file).isDirectory()) {
|
if (fs.statSync(file).isDirectory()) {
|
||||||
console.log('mkdir', target);
|
console.log('mkdir', target);
|
||||||
@ -16,3 +16,7 @@ export function copyRecursively(file, destination) {
|
|||||||
fs.copyFileSync(file, target);
|
fs.copyFileSync(file, target);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
copyRecursively,
|
||||||
|
};
|
@ -1,4 +1,4 @@
|
|||||||
import fs from "fs";
|
const fs = require('fs');
|
||||||
|
|
||||||
[
|
[
|
||||||
'intermediates',
|
'intermediates',
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import fs from "fs";
|
const fs = require('fs');
|
||||||
import path from "path";
|
const path = require('path');
|
||||||
import {copyRecursively} from "./_functions.js";
|
const {copyRecursively} = require('./_functions.js');
|
||||||
|
|
||||||
|
|
||||||
[
|
[
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import fs from "fs";
|
const fs = require('fs');
|
||||||
import path from "path";
|
const path = require('path');
|
||||||
import {copyRecursively} from "./_functions.js";
|
|
||||||
|
|
||||||
// These folders must exist for nodemon not to loop indefinitely.
|
// 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);
|
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
|
// Copy package.json
|
||||||
fs.copyFileSync('package.json', 'dist/package.json');
|
fs.copyFileSync('package.json', 'dist/package.json');
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
setRoutes(%routes%);
|
setRoutes(%routes%);
|
||||||
setPublicUrl(%publicUrl%);
|
setPublicUrl(`%publicUrl%`);
|
||||||
|
|
||||||
new View({
|
new View({
|
||||||
hydrate: true,
|
hydrate: true,
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"composite": true,
|
"composite": true,
|
||||||
|
|
||||||
|
"module": "CommonJS",
|
||||||
|
|
||||||
"baseUrl": "../dist",
|
"baseUrl": "../dist",
|
||||||
"rootDir": "./",
|
"rootDir": "./",
|
||||||
"sourceRoot": "./",
|
"sourceRoot": "./",
|
||||||
|
Loading…
Reference in New Issue
Block a user