【问题标题】:how to use webpack in visual studio 2013如何在 Visual Studio 2013 中使用 webpack
【发布时间】:2017-02-16 09:48:13
【问题描述】:

Webpack 中的Index.html

 <!doctype html>
  <html>
  <head>
  <base href="/">    
  <title>ng2-webpack</title>
  </head>
  <body>
   <my-app>Loading  content here ...</my-app>      
 </body>
 </html>

SystemsJS 中的Index.html

 <!DOCTYPE html>
 <html>
 <head>
    <!-- Polyfill(s) for older browsers -->
  <script src="node_modules/core-js/client/shim.min.js"></script>
  <script src="node_modules/zone.js/dist/zone.js"></script>
  <script src="node_modules/reflect-metadata/Reflect.js"></script>
  <script src="node_modules/systemjs/dist/system.src.js"></script>
  <script src="systemjs.config.js"></script>
     System.import('app').catch(function (err) { console.error(err); });
 </script>
 </head>
<body>
<my-app>Loading  content here ...</my-app>         
 </body>
 </html>

数据库检索代码

           this.headers = new Headers();
            this.headers.append('Content-Type', 'application/json; charset=utf-8');                
            let options = new RequestOptions({
                method: RequestMethod.Post,
                url: "data.aspx/getvalue",                   
                headers: this.headers,
                  body:{log:this.login}
            });
             return this._http.request(new Request(options)).retry(2)
            .map((response: Response)=>this.extractData(response))
            .do(data => {this.temp=data, console.log('getStepList:'+ JSON.stringify(JSON.parse(this.temp.d)))})
            .catch(this.handleError);  

使用系统js

当使用npm run command all ts file converted into js 然后run index.html in visual studio 然后一切正常

将 systemjs 切换到 webpack

当我将systemjs to webpack 切换为开发Index.html not include any filets file converted into js 仅在使用npm run build 构建应用程序时,所以每次我必须构建应用程序然后将该dist 文件夹放入Visual Studio 中以从数据库中获取数据。

I felt this process headache so can any one tell me how to use in `visual studio 2013` 

【问题讨论】:

    标签: angular visual-studio-2013 webpack systemjs webpack-dev-server


    【解决方案1】:

    查看此链接以将 Web 包与 2015 年以前的 Visual Studio 版本一起使用。

    https://github.com/webpack/docs/wiki/Usage-with-Visual-Studio

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-11-25
      • 2015-12-22
      • 2018-04-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-01-27
      • 2014-01-10
      相关资源
      最近更新 更多