Skip to content

Commit

Permalink
fix(bazel): devserver entry_module should have underscore name
Browse files Browse the repository at this point in the history
This commit fixes a bug whereby the path of the entry_module is not
consistent with the workspace name, which does not permit dashes
in the name.
  • Loading branch information
kyliau committed Dec 18, 2018
1 parent c986d3d commit 35eb39f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ ts_devserver(
"npm/node_modules/zone.js/dist",
"npm/node_modules/tslib",
],
entry_module = "<%= name %>/src/main.dev",
entry_module = "<%= utils.underscore(name) %>/src/main.dev",
serving_path = "/bundle.min.js",
static_files = [
"@npm//node_modules/zone.js:dist/zone.min.js",
Expand Down
9 changes: 9 additions & 0 deletions packages/bazel/src/schematics/bazel-workspace/index_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ describe('Bazel-workspace Schematic', () => {
expect(workspace).toMatch('ANGULAR_VERSION = "6.6.6"');
});

it('should have the correct entry_module for devserver', () => {
const options = {...defaultOptions, name: 'demo-app'};
const host = schematicRunner.runSchematic('bazel-workspace', options);
const {files} = host;
expect(files).toContain('/demo-app/src/BUILD.bazel');
const content = host.readContent('/demo-app/src/BUILD.bazel');
expect(content).toContain('entry_module = "demo_app/src/main.dev"');
});

describe('WORKSPACE', () => {
it('should contain project name', () => {
const options = {...defaultOptions};
Expand Down

0 comments on commit 35eb39f

Please sign in to comment.