This is really more of a feature request.
Mac OS // El Capitan
➜ dist git:(angular2) ng --version
(node:17937) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
angular-cli: 1.0.0-beta.8
node: 6.2.2
os: darwin x64
ng build and ng build -prod both produce an index.html that has inline JavaScript:
<script>
System.import('system-config.js').then(function () {
System.import('main');
}).catch(console.error.bind(console));
</script>
This makes applications built using ng build -prod incompatible with CSPs that disable unsafe content sources (e.g. unsafe-inline and unsafe-eval), having to enable these unsafe sources negates the security benefits of having a CSP.
Removing these inline scripts significantly increases the complexity of the builds (afaik) since there is no support for user-defined tasks, nor an easy way to use systemjs's bundler which is capable of creating CSP-compatible builds.
N/A
The desired behavior here is for angular-cli production builds to support CSP and increase application security by default.
Closed as issue was made obsolete by #1455.
@filipesilva Could this be re-opened? I still cannot figure out a way to make the Angular CLI work with CSP. There are many places where eval and Function are used in the compiled javascript.
@saulshanabrook can you make a new issue for the problem you are experiencing? The description on this one is not applicable anymore.
@filipesilva OK, opened https://github.com/angular/angular-cli/issues/6872
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
@filipesilva Could this be re-opened? I still cannot figure out a way to make the Angular CLI work with CSP. There are many places where
evalandFunctionare used in the compiled javascript.