Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): support inline javascript in less
Browse files Browse the repository at this point in the history
  • Loading branch information
filipesilva committed Aug 21, 2018
1 parent b4a3076 commit f9de24a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ export function getStylesConfig(wco: WebpackConfigOptions) {
loader: 'less-loader',
options: {
sourceMap: cssSourceMap,
javascriptEnabled: true,
...lessPathOptions,
}
}]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -529,4 +529,22 @@ describe('Browser Builder styles', () => {
tap((buildEvent) => expect(buildEvent.success).toBe(true)),
).toPromise().then(done, done.fail);
});

it(`supports inline javascript in less`, (done) => {
const overrides = { styles: [`src/styles.less`] };
host.writeMultipleFiles({
'src/styles.less': `
.myFunction() {
@functions: ~\`(function () {
return '';
})()\`;
}
.myFunction();
`,
});

runTargetSpec(host, browserTargetSpec, overrides).pipe(
tap((buildEvent) => expect(buildEvent.success).toBe(true)),
).toPromise().then(done, done.fail);
});
});

0 comments on commit f9de24a

Please sign in to comment.