Skip to content

Commit

Permalink
chore: exclude schematics files from build
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminDobler committed May 22, 2019
1 parent d61a0dd commit ad0750c
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 17 deletions.
8 changes: 0 additions & 8 deletions builders/build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,19 @@ const path_1 = require("path");
const child_process_1 = require("child_process");
let nodeProcess;
exports.execute = (options, context) => {
let serverOptions;
let buildElectronOptions;
const setup = () => __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
const workspaceHost = core_1.workspaces.createWorkspaceHost(new node_1.NodeJsSyncHost());
const { workspace } = yield core_1.workspaces.readWorkspace(context.workspaceRoot, workspaceHost);
console.log("Workspace");
const project = workspace.projects.get(context.target.project);
console.log(workspace.projects.get(context.target.project).sourceRoot);
resolve(project);
}));
});
console.log("Node Builder");
return rxjs_1.from(setup()).pipe(operators_1.map(project => normalizeOptions(options, project, context)), operators_1.map(options => buildConfig(options)), operators_1.switchMap(webpackConfig => build_webpack_1.runWebpack(webpackConfig, context)), operators_1.tap(x => {
console.log("Run node app ", path_1.join(options.outputPath, x.emittedFiles[0].file));
startNodeApp(path_1.join(options.outputPath, x.emittedFiles[0].file));
}), operators_1.mapTo({ success: true }));
};
function startNodeApp(mainFile) {
console.log("Start Node app");
if (nodeProcess) {
nodeProcess.kill();
nodeProcess = null;
Expand Down Expand Up @@ -66,4 +59,3 @@ function buildConfig(options) {
return webpackConfig;
}
exports.default = architect_1.createBuilder(exports.execute);
//# sourceMappingURL=index.js.map
2 changes: 1 addition & 1 deletion builders/build/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file.
1 change: 0 additions & 1 deletion schematics/application/files/src/main.js

This file was deleted.

1 change: 0 additions & 1 deletion schematics/application/files/src/main.js.map

This file was deleted.

4 changes: 1 addition & 3 deletions schematics/application/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,14 @@ function default_1(options) {
: core_1.join(core_1.normalize(newProjectRoot), options.name);
const sourceDir = `${appDir}/src`;
options.appProjectRoot = sourceDir;
console.log("Add Node app! ", sourceDir);
return schematics_1.chain([updateAngularConfig(options), addFiles(options)]);
});
}
exports.default = default_1;
function updateAngularConfig(options) {
return (tree, _context) => __awaiter(this, void 0, void 0, function* () {
const workspace = config_1.getWorkspace(tree);
const project = workspace.projects[options.name] = {
workspace.projects[options.name] = {
projectType: workspace_models_1.ProjectType.Application,
root: "projects/node1",
sourceRoot: options.appProjectRoot,
Expand Down Expand Up @@ -66,4 +65,3 @@ function addFiles(options) {
schematics_1.move(options.appProjectRoot)
]));
}
//# sourceMappingURL=index.js.map
2 changes: 1 addition & 1 deletion schematics/application/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
"rootDir": "/",
"skipDefaultLibCheck": true,
"skipLibCheck": true,
"sourceMap": true,
"sourceMap": false,
"strictNullChecks": false,
"target": "es6",
"types": ["jasmine", "node"]
},
"include": ["builders/**/*", "schematics/**/*"],
"exclude": ["src/*/files/**/*"]
"exclude": ["schematics/*/files/**/*"]
}

0 comments on commit ad0750c

Please sign in to comment.