在将Angular Cli从SystemJs切换到Webpack之后,我不确定如何包含JS文件(供应商).
For example
选项A
I have some js files that were installed via npm. Adding script tags to the head tag like this does not work. Nor does it seem like the best way.个
<head>
<script src="node_modules/some_package/somejs.js">
</head>
//With systemJs I could do this
<head>
<script src="vendor/some_package/somejs.js">
</head>
选项B
Include these js files as part of the webpack bundle. This seems like the way it probably should be done. However I am not sure how to do this as all of the webpack code seems to be hidden behind the angular-cli-webpack node package. I was thinking maybe there is another webpack config that we might have access to. But I am not sure as I didn't see one when creating a new angular-cli-webpack project.个
More Info:
我试图包含的js文件需要在Angular项目之前包含.例如jQuery和第三方js库,它们并不是真正为模块加载或typescript而设置的.
References https://github.com/angular/angular-cli/blob/master/WEBPACK_UPDATE.md个 https://github.com/angular/angular-cli/tree/webpack