File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -500,19 +500,31 @@ class Builder {
500500 * @private
501501 */
502502 static _setExternalPlugin ( externals ) {
503- return new HtmlWebpackExternalsPlugin ( {
504- externals : externals || [
505- {
506- module : 'react' ,
507- entry : 'https://11.url.cn/now/lib/15.1.0/react-with-addons.min.js?_bid=3123' ,
508- global : 'React'
509- } ,
510- {
511- module : 'react-dom' ,
512- entry : 'https://11.url.cn/now/lib/15.1.0/react-dom.min.js?_bid=3123' ,
513- global : 'ReactDOM'
503+ const newExternals = externals || [
504+ {
505+ module : 'react' ,
506+ entry : 'https://11.url.cn/now/lib/15.1.0/react-with-addons.min.js?_bid=3123' ,
507+ global : 'React'
508+ } ,
509+ {
510+ module : 'react-dom' ,
511+ entry : 'https://11.url.cn/now/lib/15.1.0/react-dom.min.js?_bid=3123' ,
512+ global : 'ReactDOM'
513+ }
514+ ] ;
515+
516+ // 增加 cross-origin 的头
517+ newExternals . map ( ( external ) => {
518+ external . entry = {
519+ path : external . entry ,
520+ attributes : {
521+ crossorigin : 'anonymous'
514522 }
515- ]
523+ }
524+ } ) ;
525+
526+ return new HtmlWebpackExternalsPlugin ( {
527+ externals : newExternals
516528 } ) ;
517529 }
518530
Original file line number Diff line number Diff line change 11{
22 "name" : " builder-webpack3" ,
3- "version" : " 0.2.17 " ,
3+ "version" : " 0.2.18 " ,
44 "description" : " webpack项目构建器." ,
55 "main" : " lib/index.js" ,
66 "scripts" : {
You can’t perform that action at this time.
0 commit comments